zoukankan      html  css  js  c++  java
  • Java基础多线程之实际开发中常见写法:

    class ThreadDemo
    {
        public static void main(String[] args)
        {
            new Thread()
            {
                public void run()
                {
                    for(int i = 0;i<100;i++)
                    {
                        System.out.println(Thread.currentThread().getName() + " .... "+i);
                    }
                }
            }.start();
            
            for(int i = 0;i<100;i++)
            {
                System.out.println(Thread.currentThread().getName() + " .... "+i);
            }
            
            Runnable r = new Runnable()
            {
                public void run()
                {
                    for(int i = 0;i<100;i++)
                    {
                        System.out.println(Thread.currentThread().getName() + " .... "+i);
                    }
                }
            };
            new Thread(r).start();
        }
    }
  • 相关阅读:
    EasyARM-Linux工具
    EasyARM-Linux文件系统
    EasyARM-Linux使用
    公差-PCBA
    novoton-USBDevice使用
    novoton-RTC使用
    novoton-ADC使用
    novoton-I2C使用
    novoton-timer使用
    novoton-usart使用
  • 原文地址:https://www.cnblogs.com/cxmsky/p/2861093.html
Copyright © 2011-2022 走看看