Stuck in Ternary Conditional part


#1

Okay so I cannot understand this part no matter how many times I read it.

Here is the lesson : https://www.codecademy.com/en/courses/learn-java/lessons/conditionals-control-flow/exercises/ternary-conditional?action=resume

This is the error -

Ternary.java:6: error: illegal start of expression
char canDrive = (fueLevel = = 3) ? 'Y' : 'N';
^
1 error

`

My code -

public class Ternary {
public static void main(String[] args) {

	int fuelLevel = 3;

	char canDrive = (fueLevel = = 3) ? 'Y' : 'N';
	System.out.println(canDrive);

}

}
Thanks In Advance!
`


#2

HI this part

(fueLevel = = 3) ? 'Y' : 'N'

remove the space between the = =
then you wrote

fueLevel

instead of

fuelLevel

#3

Ohhh that's why...
I'm an idiot.
Any way thanks a lot!
It was giving me a headache :3


#5

A post was split to a new topic: The 'Next button is disabled and not able to move to the next lesson


#6