String[] hobbys = { "sports", "game", "movie" }; System.out.println("循环输出数组中元素的值:"); // 使用循环遍历数组中的元素 for(int i = 0;i<= hobbys.length;i++){ System.out.println(hobbys[i]);
循环输出数组中元素的值: sports game movie Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3 at java6_5.main(java6_5.java:11) 为甚后面会有这些?