switch
class SwitchStmt { public static void main( String args[ ] ) { int x = 10, y = 20, z = 30; switch ( 10+10 ) { case x: System.out.print( x ); break; case y: System.out.print( y ); break; case z: System.out.print( z ); break; default: System.out.print( 40 ); break; } } }
class BreakKeyword { public static void main( String args[ ] ) { int x = 10, y = 20; switch ( x+y ) { case 20: System.out.print( x ); break; case 30: System.out.print( y ); case 40: System.out.print( x+y ); break; default: System.out.print( 50 ); } } }