Question: JAVA write a switch statement that does the following: if the integer x is 1 it will print 1 System.out.println(1); if the integer x is
JAVA
write a switch statement that does the following: if the integer x is 1 it will print 1 System.out.println("1"); if the integer x is 2 it will print 2 System.out.println("2"); if the integer x is 3 it will print 3 System.out.println("3"); if the integer x is 4 it will print 4 System.out.println("4"); for all other values of integer x it will print "Value not 1,2,3,4."
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
