package com.gxx.threads.study.test11; /** * 测试类-测试线程yield()让出CPU * @author Gxx */ public class Test { /** * main方法 * @param args */ public static void main(String[] args) { System.out.println("main 开始"); MyThread threadA = new MyThread(); threadA.setName("线程A"); threadA.start(); MyThread threadB = new MyThread(); threadB.setName("线程B"); threadB.start(); System.out.println("main 结束"); } }