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

 

posted @ 2021-08-18 15:56  小风扇呜呜呜  阅读(17)  评论(0)    收藏  举报