JDK5.0 break 标签的用法

public class MyTest {
public static void main (String[] args){
Random random = new Random(48);
outer1:
for(int i=0; i<100; i++){
int j = random.nextInt(26)+'a';
System.out.print((char)j + "," + i + ";" );
outer2:
switch(j){
case 'a':
case 'e':
case 'i':
case 'o':
case 'u': System.out.println("vowel");
break outer2;
case 'y':
case 'w': System.out.println("sometimes a
vowel");
break outer1;
default : System.out.println("consonant");
}
}
}
}

你可能感兴趣的:(break)