摘要: java 实现多线程两种方式 1.继承threaa类 2.实现runnable 接口thread其实是runnable的一种实现通过调用thread.start(),会通过jvm找到run()方法,启动runable 好处 避免点继承的局限,一个类可以继承多个接口thread code:public static void main(String[] args) { MyThread thread1 = new MyThread("thread one"); MyThread thread2 = new MyThread("thread two"); . 阅读全文
posted @ 2013-10-24 19:30 Jsaint 阅读(118) 评论(0) 推荐(0)