Home Segments Top Top Previous Next

394: Mainline

An ifelse statement may include an empty statement—one that consists of a semicolon only—in the if-true position. Thus, the following tests are equivalent:

if (length < 60) System.out.println("It is short!"); 

if (length >= 60) ; else System.out.println("It is short!");