Switch Statement in Java
What is a Switch Statement? java switch statement in Java is used to execute one block of code among multiple alternatives based on the value of a variable. It is an alternative to using multiple if-else conditions. public class Switch1 { public static void main(String[] args) { int x=3; switch(x) { case 0: System.out.println(“0”); break; […]
Switch Statement in Java Read More »