选择题数组

public class TestString {

public static void main(String[] args) {
String [] s =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
}

}
注意:
s[10] 错误,数组下标越界异常。
posted @ 2019-06-10 01:03  青蛙跳跳  阅读(101)  评论(0编辑  收藏  举报