標籤:pager hello device method 開始 translate 首字母 byte 執行個體
1.
Java Standard Edition (Java SE)
Java Enterprise Edition (Java EE):
geared toward developing large-scale, distributed networking applications and web-based applications
Java Micro Edition (Java ME):
geared toward developing applications for small, memory-constrained devices, such as cell phones, pagers and PDAs.
2. Javadoc comments:
使用/**開始,*/結束;javadoc utility program 讀Javadoc來做html文檔
3. implicitly imports java.lang,所以不用寫
4.
類的命名:每個詞的首字母大寫:ClassName,不能以數字開頭
變數和函數的命名:首詞首字母小寫,其他首字母大寫:variName
5.
// turn into .class containing Java bytecodes
javac fileName.java
// javac *.java多個java檔案同時編譯
// translated by JVM for os, execute
java fileName
6. Integer division: 小數部分直接拋棄
7. static method:
不需要建立其執行個體就可以用。main是static的,而且每個class裡都可以有一個main,具體用哪個根據java命令來定。
8.
primitive types:
boolean, byte, char, short, int, long, float, double
reference types:
Objects that are referenced may each contain many instance variables and methods. 不是primitive,就是reference。
下面是代碼時間:)
// for dialog windowimport javax.swing.JOptionPane;//Only ONE publicpublic class test {public static void main(String[] args) {// Standard output object. to command lineSystem.out.print("first");// add /nSystem.out.println("Hello world!");// format-controlfloat i = 3.2f;System.out.printf("%s\n%.2f", "Hello", i);// input dialog window. get input.String name = JOptionPane.showInputDialog("what‘s your name?");// format control of stringString msg = String.format("Welcome, %s", name);// first: position of window. null = centerJOptionPane.showMessageDialog(null, msg);}}
Java-basic-1