正在加载图片...
一维数组 使用数组的步骤: 1.声明数组int[]score; 常量或变量 2.分配空间 score=new int; 动态初始化 3.元素赋值score[0]=95,.,score[4]=67; 4.引用数组元素 系统会给每个数组元素一个 必须是常量:和元素个数相等。 默认的值。布尔-false score=new int 95,89,79,64,67: 数值一0 string一null int[]score:={95,89,79,64,67; int[]score=new int[5]; String[str={"How","are","you"); score=new int90,89); 88 动态初始化 一维数组 使用数组的步骤: 1. 声明数组 int[ ] score; 2. 分配空间 score = new int[5]; 3. 元素赋值 score[0] = 95, . ,score[4] = 67; 4. 引用数组元素 score=new int[5]{95,89,79,64,67}; 系统会给每个数组元素一个 默认的值。布尔-false 数值—0 string—null 常量或变量 int[ ] score={95,89,79,64,67}; String[ ] str={"How", “are", "you"}; 必须是常量:和元素个数相等。 int[ ] score=new int[5]; score=new int[]{90,89};
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有