if语句
public class IfTest2 {
public static void main(String[] args) {
int x = 2;
if (x == 3) {
System.out.println("x must be 3");
}
else
{
System.out.println("x is NOT 3");
}
System.out.println("This runs no matter what");
}
}
输出:
x is NOT 3
This runs no matter what
浙公网安备 33010602011771号