|
|
`IfTest' example program: demonstrates nested `if's; work out what the result should be
IfTest.java
class IfTest
{
public static void main(String args[])
{
if (2 > 1)
if (3 < 2)
{
System.out.println("a");
}
else
if (4 < 3)
{
System.out.println("b");
}
else
{
System.out.println("c");
}
else
System.out.println("d");
}
}
|