String[] s = new String[3];
System.out.println(s[0].length());What happens?
- A
ArrayIndexOutOfBoundsException is thrown
- B
Prints null
- C
Prints 0
- Dcheck_circle
NullPointerException is thrown
Explanation
s[0] is null. Calling .length() on null throws a NullPointerException.