Help 9/11 ternary conditionals


Continuing the discussion from 9/11 Ternary Conditional help?!:

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

	int fuelLevel = 3;

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



		char canDrive = (fuellevel > 0)? 'y' : 'n';
  symbol:   variable fuellevel
  location: class Ternary
1 error

<do not remove the three backticks below>

not sure what is wrong i dont think it is actually storing fuellevel but i have just started and may be mistaken.


Why do you say that it is wrong? What is the problem?

Looks like you've posted about half of an error message. Have you read it? Was there trouble understanding what it's saying, or addressing the problem it presented? If so, then that's probably what you should be asking about instead (and include the other half of the thing you're asking about)


that was all that was in the output window


It's not, and you're only responding to about 20% of what I said :confused: I give up. Please note that the easier you make it to reply, the more likely it is that you will get what you want.


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