Ternary operator ex9


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

```public class Ternary { public static void main(String[] args) {
	int fuelLevel = 3;

	char canDrive =(fuelLevel > 0)?'Y':'N';
	System.out.println(canDrive);

}

}

Replace this line with your code.

<do not remove the three backticks above>

#2

So what is the problem?
This code is absolutely correct.
@javawhiz22876


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.