關於我

就讀逢甲大學
正在修java


2015年3月12日 星期四

helloworldAPP


1.到下載java的網站

http://www.oracle.com/technetwork/java/javase/downloads/index.html


2.選右邊倒數第二個

Tutorials


3.選Getting Started


4.選The "Hello World!" Application


5.選"Hello World!" for Microsoft Windows


6.複製此程式碼 並建立wordpad 再改檔名與副檔名.java


/** * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } }


7.開啟cmd
確認java與javac皆有東西跑出來
(如果沒有請參照上一篇如何改環境變數)

8.cd空一格複製上自己資料夾的位址

9.再打dir

10.再打javac 檔案名稱+副檔名

11.再打java 檔案名稱

12.完成圖



沒有留言:

張貼留言