第四天 数组(基础)

数组的概念:

1 int[] arr = {1,2,3}; //最推荐的用法    字面量方式
2 int[] arr = new int[10] //存一个10个字符之内的数组,有默认值,int的默认值是0,String类型的是空
  赋值:
  arr[0] = 1;
  arr[1] = 3;
3 int[] arr = new int[5]{1.2.3.4.5};//不常用,但需要认识
原文地址:https://www.cnblogs.com/miaomeng/p/8624847.html