多线程记录操作记录

来源:互联网 发布:淘宝的无印良品都是假 编辑:程序博客网 时间:2024/04/29 15:14

之前是同步记录操作记录,现在改为多线程来异步记录操作记录

package cn.tim.thread;public class TestThreadApplication {    /**     * 多线程的一个简单例子     */    public static void main(String[] args) {        String name = "操作记录的操作";        Thread t1 = new Thread() {            public void run() {                System.out.println(name);            }        };        // 开启线程1        t1.start();        System.err.println("继续执行业务逻辑代码");    }}
1 0
原创粉丝点击