X1154: Bad Jeroo Exceptions

The method below takes an array of Jeroos and should throw an exception if any Jeroo in the array is null or if any is facing North.

In the conditionals below...

  • If a jeroo in the array is null, throw an IllegalArgumentException
  • If a jeroo is facing north, throw an IllegalStateException

The exception should contain a message that reports if the jeroo was null or facing north. These messages have been provided for you in the conditionals below.

If no jeroos are bad, this method does not need to do anything and does not need to return anything.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.