websprinter
0
Q:

one line if statement java

statement ? true 	: 	false
  ^		  |	 ^			  ^
condition |   (instruction)
  		  |  If the statement:  
  		  |	is true | is false
--------------------------------------------------------------------------------
 Example:
int i = 10;

String out = i > 8 ? "Bigger than Eight!" : "Smaller than Eight!";
System.out.println(out);
2
statement ? true : false
4

New to Communities?

Join the community