实例 Java if 语句

x
 
public class Main {
  public static void main(String[] args) {
    if (20 > 18) {
      System.out.println("20 is greater than 18"); // obviously
    }  
  }
}
                    

输出结果

20 is greater than 18