摘要: import java.io.*;
//多线程编程
public class MultiThread
{
public static void main(String args[])
{
System.out.println("我是主线程!");
//下面创建线程实例thread1
ThreadUseExtends thread1=new ThreadUseExtends();
//创建thread2时以实现了Runnable接口的THhreadUseRunnable类实例为参数
Thread thread2=new Thread(new ThreadUseRunnable(),"SecondThread");
thread1.start();//启动线程thread1使之处于就绪状态
//thread1.setPriority(6);//设置thread1的优先级为6
阅读全文