正在加载图片...
Class java, lang Thread d米右以下形式的构诰函数 class MyThread extends Thread public void run(t System. out. println(“ executing as a thread”) Ircauuaule taget, bulg ane Thread th=new My Thread; punc volubly Thread类的子类需覆盖rumn(方法Class java.lang.Thread • Thread类有以下形式的构造函数: Thread() Thread(String name) Thread(Runnable target) Thread(Runnable target, String name) • Thread类中线程的主要功能方法是: public void run() {} • Thread类的子类需覆盖run()方法 class MyThread extends Thread{ public void run(){ System.out.println(“executing as a thread”); } } Thread th=new MyThread();
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有