本帖最后由 石贤芝 于 2013-5-13 23:46 编辑
- class ThreadTest
- {
- public static void main(String[] args)
- {
- new Thread(new Runnable()
- {
- public void run()
- {
- System.out.println("runnable run");
- }
- })
- {
- public void run()
- {
- System.out.println("subThread run");
- }
- }.start();
- }
- }
复制代码 上面代码的输出结果是 subThread run
而下面代码- class ThreadTest
- {
- public static void main(String[] args)
- {
- new Thread(new Runnable()
- {
- public void run()
- {
- System.out.println("runnable run");
- }
- })
- {
- }.start();
- }
- }
复制代码 的输出结果是: runnable run
视频中听得还是不大明白,烦请各位详细说明一下,谢谢 |