1 / 10

程式語言實習

程式語言實習. 100 學年 第二學期. 課程地點 : SF551 課程時間 : 每周五 13:40~15:30 參考書籍 : Introduction to Java Programming 助教 : 孫逸峰 助教 Office : SF650 Office hour: TUE 14:30~16:30. 課程配分比例 : 依照正課說明之比例分配. 課程注意事項 : 請勿遲到 每周必點名 , 若無法出席 , 請依照「輔仁大學請假規則」辦理請假 考試不作弊 ,請勿挑戰這極限。. Java 開發環境.

ivie
Download Presentation

程式語言實習

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 程式語言實習 100學年 第二學期 課程地點 :SF551 課程時間 : 每周五 13:40~15:30 參考書籍 :Introduction to Java Programming 助教 : 孫逸峰 助教Office:SF650 Office hour: TUE 14:30~16:30

  2. 課程配分比例: 依照正課說明之比例分配 • 課程注意事項: • 請勿遲到 • 每周必點名, 若無法出席, 請依照「輔仁大學請假規則」辦理請假 • 考試不作弊 ,請勿挑戰這極限。

  3. Java 開發環境 • JDK(Java Development Kit) • Eclipse • • 需安裝JRE(Java Runtime Environment)或 JDK

  4. 建立Java 環境 - JDK • 下載JDK(Java Development Kit) • 安裝JDK • 設定開發環境 • 開啟CMD,測試JDK是否安裝成功

  5. 建立Java 環境 - Eclipse • 下載Eclipse • 解壓縮後執行eclipse.exe 即可 • 開啟Java專案

  6. 第一個Java 程式 public class FirstJava { public static void main (String [] argv) { System.out.println ("Hello Java World"); } } 將程式碼存檔為 .java檔

  7. 使用JDK編譯程式 • 開啟CMD • 切換目錄至程式碼所在檔案的資料夾 • 編譯程式碼輸入:javac FirstJava.java • 若編譯錯誤,進行debug • 編譯成功,輸入 :java FirstJava • 程式執行,並顯示結果

  8. 使用Eclipse編譯程式 • 開啟Eclipse程式 • [File][New][Java Project] • 輸入Project name (可隨意輸入) • Project layout選第一個,之後點選[Finish] • 在Project 123上點滑鼠右鍵,選擇[New][Class] • 輸入Name (程式碼的檔名),並將”public static void main(String[] args) “打勾,點選[Finish] • 編寫程式碼 • 按Ctrl+F11即可編譯並執行程式

  9. Java 檔名即變數名稱規範 • 必須為英文字母開頭,大小寫均可,也可用 _or $ 這兩個符號開頭。 • 不能使用保留字,例如 for 、 public … 等 • 其他注意事項: • 英文字大小寫視為不同字母 • 全形及半形不同

  10. 習作 • 使用Eclipse編譯並執行 Java程式碼 • 使用JDK編譯並執行 Java程式碼 PPT下載位址: http://oss.csie.fju.edu.tw/~neilsun100/program.html

More Related