1月25日 作业 多线程

package com.lianxi;

public class LX extends Thread{
    

        public void run()
        {
            outInfo();
        }

    private void outInfo() 
    {
        for (int i = 0; i < 10; i++) 
        {
            System.out.println("复习!复习!");

            try 
            {
                Thread.sleep(100);
            } catch (InterruptedException e)
            {
                e.printStackTrace();
            }
        }

    }
}
        

package com.lianxi;



public class lol {

    public static void main(String[] args) {
        // TODO 自动生成的方法存根


            LX l = new LX();
            
            l.start();
            
            LX p = new LX();
            p.start();
    }

}
原文地址:https://www.cnblogs.com/yifangtongxing/p/5158673.html