Macbook pro (OS X EI Captian 10.11.5)
java 1.7.0_79
1. Prepare java code by 文字編輯器
// 1. Filename = class name
// 2. Prepare java code (filename name.java)
// 3. Command mode
// 3.1 Compile: javac name.java
// 3.2 Execute: java name(.class)
public class JavaHello {
public static void main(String []args) {
System.out.println("Hello World");
}
}
2. Compile:
javac JavaHello.java
3. Execute
java JavaHello
4. Result
沒有留言:
張貼留言