class Demo8
{
public static void main(String[] args)
{
new Thread( new Runnable()//实现Runnable()的匿名内部类的对象
{
public void run()
{
System.out.println("Runable run()");
}
} )
{
public void run()
{
System.out.println("Thread run()");
}
}.start(); //整体是继承Thread的匿名内部类对象调用start方法
System.out.println("Hello World!");
}
}
|