作者: 王新年 时间: 2013-12-9 16:17
只需要将while语句嵌套在case中,如下代码:
public stati void start(){
Executors.newSingleThreadExecutor().execute(new Runnable(){
public void run(){
switch(type){
case COMMON: while(true){commonService();} break;
case EXPRESS: while(true){expressService();} break;
case VIP: while(true){vipService();} break;