|I'm not sure why you are getting an error. Without testing it, I |
would guess one of two things. First, are you absolutely sure
your IsNumberPrime method takes an int and returns a
boolean? Maybe you have an overloaded method of the same
name that returns something else? If it returns a boolean,
then that's what is needed left of the "?" .
Another point is that this construct is just two operators that
yield an expression, but what is the type of the expression?
Println returns void. If you don't want to take the value of the
expression, just use if/else.
Alternatively, put the ?: expression inside the println call. The
expression will be the argument to println, and will give you a
string, whose value depends on whether the number is prime.