For one line statments like that, you may omit the braces.Code:if ((x>0) && (x<=10)) { System.out.println("x is between 0 and 10"); } else { System.out.println("x is less than 0 or greater than 10"); }
|
Results 1 to 4 of 4
Thread: If...and...thenThreaded View
|
Click Here to Expand Forum to Full Width |