本帖最后由 zl78365336 于 2013-12-9 14:03 编辑
怎么理解普通窗口.setNumber(i);
快速窗口.setType(CustomerType.EXPRESS);
VIP窗口.setType(CustomerType.VIP);
不都应该调用一样的方法吗?
- public static void main(String[] args) {
- //产生4个普通窗口
- for(int i=1;i<5;i++){
- ServiceWindow window = new ServiceWindow();
- window.setNumber(i);
- window.start();
- }
-
- //产生1个快速窗口
- ServiceWindow expressWindow = new ServiceWindow();
- expressWindow.setType(CustomerType.EXPRESS);
- expressWindow.start();
-
- //产生1个VIP窗口
- ServiceWindow vipWindow = new ServiceWindow();
- vipWindow.setType(CustomerType.VIP);
- vipWindow.start();
-
复制代码
|