package com.itheima.arry; public class ArryDemo1 { public static void main(String[] args) { //掌握数组访问 int[] ages=new int[]{12,52,630}; //修改数组中数据 ages[0]=66; ages[1]=100; System.out.println(ages[0]); System.out.println(ages[1]); System.out.println(ages[2]); //数组元素个数 System.out.println(ages.length); //获取数组最大索引 总长度减一除了无元素情况 int[] a=new int[]{}; System.out.println(a.length); } }
标签:JAVA,int,ages,System,访问,数组,println,out From: https://www.cnblogs.com/pengsuoqun123/p/18041669