Thread和Runnable分别实现售票系统
继承Thread类
package com.yuecheng.hspedu.Runnable00;
//使用多线程,模拟三个窗口同时售票
public class Runnable06 {
public static void main(String[] args) {
conductor1 conductor1 = new conductor1();
conductor1 conductor2 = new conductor1();
conductor1 conductor3 = new conductor1();
//可能会出现票的超卖现象
conductor1.start();//启动售票线程
conductor2.start();//启动售票线程
conductor3.sta