zoukankan      html  css  js  c++  java
  • 作业

    package come.hanqi;
    
    public class MyThread extends Thread{
        
        public void run() {
            
            
        
    
        
            
            for (int i = 0; i < 5; i++) {
                System.out.println("淄博汉企。");
                
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    // TODO 自动生成的 catch 块
                    e.printStackTrace();
                }
                
            }
        }
    }
    package come.hanqi;
    
    public class TestThread {
    
        public static void main(String[] args) throws InterruptedException {
            // TODO 自动生成的方法存根
    
            /*for(int i=0;i<20;i++)
            {
                System.out.println("i="+i);
                Thread.sleep(1000);
            }*/
            MyThread mt=new MyThread();
            
            mt.start();//启动多线程
            //mt.outInfo();
            
    MyThread mt1=new MyThread();
            
            mt1.start();
            
            /*MyRunnable mr=new MyRunnable();
            
            Thread th=new Thread(mr);
            
            th.start();
            
             MyRunnable mr1=new MyRunnable();
            
             th=new Thread(mr1);
            
            th.start();*/
        }
    
    }

    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。
    淄博汉企。

  • 相关阅读:
    STS 配置tomcat以后,无法访问
    docker
    Java
    STS
    Java
    docker
    sql产生随机时间
    sql产生随机数
    Android 代码自动提示功能
    Activity的跳转与传值
  • 原文地址:https://www.cnblogs.com/crazy-zw/p/5158798.html
Copyright © 2011-2022 走看看