mercoledì 27 marzo 2013

Q22

Q22

Given:
public class x {
public static void main(String[] args) {
String theString = "Hello World";
System.out.println(theString.charAt(11));
}
}

What is the result?
A.
There is no output
B.
d is output
C.
A StringIndexOutOfBoundsException is thrown at runtime
D.
An ArrayIndexOutOfBoundsException is thrown at runtime
E.
A NullPointException is thrown at runtime
F.
A StringArrayIndexOutOfBoundsException is thrown at runtime
Risposta:

si ha una 

java.lang.StringIndexOutOfBoundsException e quindi la risposta è C.
riferimento: stringhe


Nessun commento:

Posta un commento