2016-07-01
package com.java1995; public class RunnableDemo { public static void main(String[] args) { MyThread mt=new MyThread(); Thread t=new Thread(mt); t.start(); for(int i=0;i<10;i++){ try { Thread.sleep(100); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("主线程"+i); } } }
package com.java1995; public class RunnableDemo { public static void main(String[] args) { MyThread mt=new MyThread(); Thread t=new Thread(mt); t.start(); for(int i=0;i<10;i++){ try { Thread.sleep(100); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("主线程"+i); } } }
时间: 2024-12-21 15:05:13