The 'Next button is disabled and not able to move to the next lesson

Hi All,
Got stuck in Ternary.
The 'Next button is disabled and not able to move to the next lesson.Though I get the result as expected, I’m getting the following message
Did you set canDrive equal to the result of the ternary expression? You can use the example to help you.

Here is my code
public class Ternary {
public static void main(String args) {

	char fuelLevel = 2 ;

char canDrive = (fuelLevel != 3)? ‘Y’ :‘N’;

System.out.println(canDrive);

Thanks in Advance !..please help me

First of all, is the next button appearing and it will not let you click on it and pass the lesson?
Or is your code just wrong?

fuelLevel should probably be an integer.

And you were asked to use this ternary expression:

(fuelLevel > 0) ? 'Y' : 'N';

but I see this in your code:

(fuelLevel != 3)? 'Y' :'N';

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