new Thread(Run).start()
public void run()
{
for(int i=0;i<5;i++)
{
System.out.println("aa");
}
}
public static void main(String[]args)
{
ThreadDownload ra=new ThreadDownload();
Thread it=new Thread(ra);
it.start();
//或者
new Thread(new ThreadDownload()).start();
for(int i=0;i<5;i++)
{
System.out.println("ff");
}
}
原文:https://blog.51cto.com/14437184/2426858