X456: Exception Output

Considering the following lines of code, what will be the output?

try {
    String str = null;
    System.out.println(str.charAt(0));
} catch(ArithmeticException e) {
    System.out.println("You have an ArithmeticException");
} catch(NullPointerException e) {
    System.out.println("You have a NullPointerException");
} finally { 
    System.out.println("You have reached here");
}


Your Answer:

Select one answer:


Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.