摘要:
1.start():启动当前线程,调用当前线程的run() 2.run():通常需要重写Tread类中的此方法,将创建的线程要执行的操作声明 在此方法中 3. currentThread():静态方法,返回执行当前代码的线程 4.getName():获取当前线程的名字 5.setName():设置当 阅读全文
摘要:
方式一:1.创建一个继承Thread类的子类2.重写Thread类的run()3.创建Thread类的子类的对象4.通过此对象调用start() public class ThreadTest { public static void main(String[] args) { MyThread t 阅读全文