摘要:
1. 创建线程(一)定义线程类, 继承Thread 并重写run(), run()称为线程体。单继承限制,尽量少用。class firstThread extends Thread { //创建线程类public void run(){ //重写run()for(int i=0; i" + i);}}public class main {public static void main(String[] args) {firstThread ft = new firstThread();//生成线程类对象ft.start();//启动线程 不能直接ft.run()for(int i=0 阅读全文
posted @ 2013-11-06 10:27
今晚打酱油_
阅读(165)
评论(0)
推荐(0)
浙公网安备 33010602011771号