1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Java

Connected

Exercise

Oddity

You have been given the list of different IDs for products meant for either land or sea. You know that land products are given an even number and sea products have odd one. To facilitate your job, you want to know which elements are odd in this list.

Instructions

100 XP
  • Call your custom method.
  • Give the correct return type for your method.
  • Inside the method, use the modulo operator, %, to check for odd numbers.