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();
        }
    }
  • 相关阅读:
    为什么需要Docker?
    shiro原理
    java面对对象
    mysql面试题
    spring boot +thymeleaf+ mybatis
    mysql语句级sql
    spring boot+spring cloud面试笔记
    Docker-compose配置
    Docker compose命令的使用
    Dockerfile操作命令说明
  • 原文地址:https://www.cnblogs.com/cxmsky/p/2861093.html
Copyright © 2011-2022 走看看