An array of multiple-choice questions

the TestString {class public 

public static void main (String [] args) {
String [] = S new new String [10];
String S1 = S [. 9];
String S2 = S [0];
System.out.println ( "S1 : "+ S1); // null
System.out.println (" S2 S [0]: "+ S2); // null
System.out.println (" s.length: "+ s.length); // 10
}

}
Note:
S [10] errors, array subscript bounds exception.

Guess you like

Origin www.cnblogs.com/2016-cxp/p/10995639.html