|
Java Reference Home | Smart Soft Home |
|
|
if
DescriptionExecute a statement(s) if (and only if) some condition is trueExample #1: One Line If
if (x<10) System.out.println("Small number");
Example #2: Multi-Line If
if (x<10) {
System.out.println("Small number");
System.out.println("Small number");
System.out.println("Small number");
}
See Alsoelse |
|