JAVA多线程总结

一、多线程的基本知识 1、创建一个线程的两个方法 通过继承Thread类本身。 通过实现Runnable接口;   通过继承Thread类的方式有一定的局限性,java中只支持单一一个类,一旦继承了其他类就不能继承Thread类了。 ----通过继承thread类创建线程 class MyThread extends Thread {        private int i = 0;     p
相关文章
相关标签/搜索