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