package com.gxx.threads.study.test15; /** * 测试类-测试方法内变量并发访问 * @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 结束"); } }