Consider the following program and predict its output:
class Main {/*from w w w .jav a 2s . co m*/ public static void main(String []args) { String str = null; switch(str) { // #1 case "null": System.out.println("null string"); // #2 break; } } }
c)
If a null value is passed to a switch statement, it results in a NullPointerException.