提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
嵌套开关语句
public class Main {/** NowJava.com - 时代Java 提 供 **/ public static void main(String[] args) { int i = 0; int j = 1; switch (i) { case 0: switch (j) { case 0: System.out.println("i is 0, j is 0"); break; case 1:/* 来 自 时 代 J a v a*/ System.out.println("i is 0, j is 1"); break; default: System.out.println("nested default case!!"); }