KissFanner 2015-11-05 08:01 采纳率: 0%
浏览 1184

求下面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();

}

}


  • 写回答

3条回答 默认 最新

  • Robot-C 2015-11-05 08:08
    关注

    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,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划