What is the output of the following code.
public class Main { public static void main(String[] args) { String switchValue = "1"; switch (switchValue) { case "1": System.out.println("in case 1"); case "2": System.out.println("in case 2"); case null : System.out.println("in case null"); default: System.out.println("in default"); } } }
Compilation error: constant expression required!
You cannot use null in string switch case constant.