package day08; public class ArrayDemo04 { public static void main(String[] args) { // 定义一个大小为3 的数组 0 1 2 , 没有索引为3 的数据 int [] arr =new int [3]; //查找数组索引外的数据 数组虎出现溢出 // Array Index out of Bounds Exception 数组索引越界异常 System.out.println(arr[3]); } }
定义一个大小为3 的数组 0 1 2 , 没有索引为3 的数据
最新推荐文章于 2024-06-13 08:37:22 发布