第一個問題的解答﹝\u000A ← 是斷行符號 \n,無法用 Unicode 表示。\u000d 則是 \r,同樣不行﹞
第二個問題:
你建立了一個物件 te,他可以呼叫 static 與 non-static 的 method。若想要在 main 裡面不建立物件就能直接呼叫其他 method,則該 method 必須要是 static。
範例↓
複製程式
public class test2 {
    public test2() {
    }
    public static void main(String[] args) {
        showA();//ok
        showB();//error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        test2 t2 = new test2();
        t2.showA();//ok
        t2.showB();//ok
    }
    
    public static void showA(){
        System.out.println("A");
    }
    
    public void showB(){
        System.out.println("B");
    }
}