package com.gxx.threads.study.test18; /** * 测试类-测试多个对象多个锁 * @author Gxx */ public class Test { /** * main方法 * @param args */ public static void main(String[] args) { System.out.println("main 开始"); NumProcess numProcess1 = new NumProcess(); MyThread threadA = new MyThread("线程A", numProcess1); NumProcess numProcess2 = new NumProcess(); MyThread threadB = new MyThread("线程B", numProcess2); threadA.start(); threadB.start(); System.out.println("main 结束"); } }