wiki:jazz/09-07-06

Version 5 (modified by jazz, 15 years ago) (diff)

--

2009-07-06

  • Java 教學
    • 下載 JDK 6 文件
    • 下載 JDK 6
    • 設定 PATH 系統環境變數:C:\Program Files\Java\jdk1.6.0_14\bin
    • 設定 CLASSPATH 系統環境變數:C:\Program Files\Java\jdk1.6.0_14\jre\lib\rt.jar
    • Java Tutorial
      // 存為 Test.java
      import java.io.*;
      import java.lang.String;
      
      public class Test
      {
        public String myData;
      
        public String getMyData()
        {
          return myData;
        }
      
        public void setMyData(String data)
        {
          myData = new String(data);
        }
      
        public static void main(String args[]) {
          Test myTest = new Test();
          myTest.setMyData("This is a test");
          System.out.print(myTest.getMyData());
        }
      }
      

Attachments (1)

Download all attachments as: .zip