黑马程序员技术交流社区

标题: 刚学的匿名类 [打印本页]

作者: GiveUp    时间: 2015-6-28 00:42
标题: 刚学的匿名类
class Z
{
        public static void main(String[] args)
        {


                new Thread (new Thread(new Runnable()
                        {
                                public void run()
                                {
                                        System.out.println("runnable run");
                                }
                        }
                        )


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

        }
}





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2