Don't understand what i'm doing wrong


here i don't understand what i'm doing wrong. they are asking if i had set canDrive to the ternary expression or not..which i did but still showing an error...!!! below is the code which i did..

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

		char canDrive = (fuelLevel>0)? 'Y' : 'N';



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

your code is just fine :slight_smile: . you just need a space between ) and ?


oh ...thank you so much ^_^


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