package com.gxx.threads.study.test17; /** * 测试类-测试实例变量并发访问,synchronized同步 * @author Gxx */ public class Test { /** * main方法 * @param args */ public static void main(String[] args) { System.out.println("main 开始"); NumProcess numProcess = new NumProcess(); MyThread threadA = new MyThread("线程A", numProcess); MyThread threadB = new MyThread("线程B", numProcess); threadA.start(); threadB.start(); System.out.println("main 结束"); } }