1 / 32

Database 實驗室專用程式語言 Java

Database 實驗室專用程式語言 Java. Outline. Programming language chaos 一小時精通 Java 不是夢 Java 環境設定. Laguage 的戰國時代. C. Delphi. C++. Pascal. Java. Basic. Delphi. C. Delphi. boolean char 16-bit byte 8-bit short 16-bit int 32-bit long 64-bit

scummings
Download Presentation

Database 實驗室專用程式語言 Java

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. Database 實驗室專用程式語言Java

  2. Outline • Programming language chaos • 一小時精通 Java 不是夢 • Java 環境設定

  3. Laguage 的戰國時代 C Delphi C++ Pascal Java Basic Delphi C Delphi

  4. boolean char 16-bit byte 8-bit short 16-bit int 32-bit long 64-bit float 32-bit double 64-bit void if…else while do…while for loop switch…case ++、-- <、<=、>、>= ==、!= &&、||、 基本型態 & 運算式

  5. Say Hello in C

  6. Class 類別 Class 的宣告方式 檔案名稱必須和有 public修飾字宣告的類別名稱一樣。

  7. Say Hello in Java

  8. Java 編譯器 • javac.exe % lsHello.java % javac Hello.java % lsHello.class Hello.java

  9. Java 直譯器 • java.exe • 啟動虛擬機器 • 執行應用程式 % lsHello.class % java HelloHello! %

  10. Fibonacci Sequence 0 1 2 3 4 5 6 7 8 9 10 … 0 1 1 2 3 5 8 13 21 34 55 …

  11. Solution in C

  12. Fibonacci (Cont.)

  13. Solution in Java

  14. Fibonacci (Cont.)

  15. Global Variable in C

  16. Global in C (Cont.)

  17. Global Variable in Java

  18. Global in Java (Cont.)

  19. struct in C

  20. Struct in C (Cont.)

  21. class in Java

  22. class in Java

  23. Types in Java • 基本型態(primitive type) • 參考型態(reference type) • 物件 • 陣列

  24. 建立與操控物件 • You must create all objects. reference String You manipulate objects with reference. 物件和 reference 之間的關係,好比電視和遙控器之間的關係一樣。

  25. 基礎型別的 Array C Java Java 中陣列的名稱只是一個 reference

  26. Array of Objects 物件陣列的 element 是指向該物件的 reference,而不是物件的真正實體,每個 element 的預設值都是null。

  27. Array of String 圖示 String[] names[0] String pets String names[1] names[2] String null names[3]

  28. 陣列的建立與初始化 匿名陣列 (anonymous array)

  29. 陣列的長度

  30. 陣列的長度 (Cont.)

  31. 陣列終極洗禮 • Java 視 array 為一個特殊的物件 • Java 使用 new 來配置陣列的實體 • Java 的 array 有一個專用的 field – length,用來表達陣列的長度

  32. Java 環境設定 • 下載 Java Development Kit (JDK) • http://java.sun.com • 設定 Java_Home 環境變數 • 更新 PATH 環境變數 • PATH=%PATH%;%JAVA_HOME%\bin;

More Related