public static void test(String str) { if (str == null | str.length() == 0) { System.out.println("String is empty"); } else { System.out.println("String is not empty"); } } And the invocation: test(null); What is the result?
An exception is thrown at runtime.
"String is empty" is printed to output
Compilation fails
"String is not empty" is printed to output.