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();
        }
    }
  • 相关阅读:
    linux中的umask命令
    The meaning of the number displayed on the man page in Linux
    Runlevel in Linux
    C语言指针与指向指针的指针
    JS函数、变量作用域
    JS对象、数据类型区别、函数
    JavaScript基础
    DOM
    HTML色码表
    GIT
  • 原文地址:https://www.cnblogs.com/cxmsky/p/2861093.html
Copyright © 2011-2022 走看看