第一个问题的解答﹝\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");
    }
}