Check out example codes for "one line if statement java". It will help you in understanding the concepts better.

Code Example 1

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);

Code Example 2

statement ? true : false

Learn ReactJs, React Native from akashmittal.com