package ch02.text; public class if001 { public static void main(String[] args) { int x = 20; int y = 30; if (x > y) { //如果x>y,输出下面代码 System.out.println(x); } else if (x < y) { //如果x<y,输出下面代码 System.out.println(y); } else { //如果x==y,输出下面代码 System.out.println("相等"); } } }