Java示例-设置优先级 Java示例-生产者消费者问题 Java示例-停止线程 Java示例-设置优先级 public class new_file { public static void main(String[] args) throws Exception { Thread thread1 = new Thread(); Thread thread2 = new Thread(); thread1.setPriority(Thread.MAX_PRIORITY); thread2.setPriority(Thread.MIN_PRIORITY); thread1.start(); thread2.start(); thread1.join(); thread2.join(); System.out.println("The priority has been set."); } } Java示例-生产者消费者问题 Java示例-停止线程