Check out example codes for "java if different ways". It will help you in understanding the concepts better.

Code Example 1

(condition) ? (what happens if true) : (what happens if false);

boolean party = friday ? play("what is love") : play("The Sound of Silence");

Learn ReactJs, React Native from akashmittal.com