Input
Output
public class Nestedswitch { public static void main(String []args) { int a = 1, b = 2; switch(a) { case 1: System.out.println("The value of a in switch: "+ a ); case 2: switch(b) { case 2: System.out.println("The value of b in nested switch:"+ b ); } break; default: System.out.println("value is not 1, 2 "); } } }