Can't understand the question


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

		char canDrive='Y';



You were supposed to use the ternary operator to check if the car has fuel.

Example of ternary operator:

//how hungry am I on a scale of 1-10
int hunger = 5;
string checkHunger = (hunger <= 5) ? "Nah you aren't hungry":'Woah buddy get yourself something to eat';


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