java 多线程编程
概念:继承 面向对象 A->B
java中创建线程的方法:
1,继承extends Thread;
public class ThreadDemo extends Thread{
public void run(){
for(int i=0;i < 10;i++){
System.out.print(i);
}
}
public static void main(String[] args){
ThreadDemo demo = new ThreadDemo();
demo.start();
}
阅读(1149) | 评论(0) | 转发(1) |