求下面java代码的输出。and WHY!!

class T {
public static void main(String[] args) {
System.out.println("T的main方法");
}

public void print() {
    System.out.println("T的print方法");
}

}

public class A extends T {

public static void main(String[] args) {

    System.out.println("A的main方法");

    new Thread(new Runnable() {

        public void run() {
            System.out.println("haoa");
        }
    }).start();

    T.main(null);

    T t = new A();
    t.print();

}

}


The AtomicInteger class has a number of uses, but one is a drop-in replacement for an atomic counter. Before Java 5, we had to write classes with access to the counter variable in synchronized blocks......
答案就在这里:Synchronization under the hood, and why Java 5 improves it
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

第一句: A的main方法
后面3句:
T的main方法
T的print方法
haoa

后面3句 没有顺序,但是T的main方法 要在T的print 之前
原因:首先没有顺序 是因为 你用了多线程,而线程的执行时间是需要计算机分配的,所以是随机的。
T的print 方法 是 你运用了多态,但是子类没有重写父类的print方法,所以还是调用的父类的print方法。

"A的main方法"
"T的main方法"
"T的print方法"
"haoa"在"A的main方法"之后任意位置