请在 下方输入 要搜索的题目:

Java中如何编写线程

Java中如何编写线程

发布时间:2025-06-27 20:36:50
推荐参考答案 ( 由 快搜搜题库 官方老师解答 )
联系客服
答案:

       Tread thread = new Thread;

       多个线程

       public class Double {

              public static void main(String] args){

                     Mythread one=new Mythread();

                     Mythread two=new Mythread();

                     one.setName("线程一");

                     two.setName("线程二");

                     one.start();

                     two.start();

              }

       }

       class Mythread extends Thread

       {

              public void run(){

                     System.out.println(this.getName());

              }

       }

专业技术学习
专业技术学习
搜搜题库系统