please tell me the answer as soon as possible
Attachments:
Answers
Answered by
1
Answer:
public class MyClass {
public static void main(String args[]) {
int var = 1;
switch(var) {
case 1: System.out.println("One");
break;
case 2: System.out.println("Two");
break;
default: System.out.println("Any other number");
}
}
}
Explanation:
Change the value of var and the output will change according to the cases.
Similar questions