纪念一下,我的第一个Java程序
D:\xampp\htdocs\Java_test>cat SimpleIfDemo.java import java.util.Scanner; public class SimpleIfDemo { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter an interger: "); int num = input.nextInt(); if (num % 5 == 0) System.out.println("Hi Five"); if (num % 2 == 0) System.out.println("Hi Even"); } } D:\xampp\htdocs\Java_test>javac SimpleIfDemo.java D:\xampp\htdocs\Java_test>ls SimpleIfDemo.class SimpleIfDemo.java D:\xampp\htdocs\Java_test>java SimpleIfDemo Enter an interger: 15 Hi Five D:\xampp\htdocs\Java_test>