A
Q. What is the result of the following code snippet?
try {
String str = null;
System.out.println(str.length());
} catch (NullPointerException e) {
System.out.println("NullPointerException!");
} catch (Exception e) {
System.out.println("Exception!");
}
- Correct Answer - Option(D)
- Views: 20
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.