8utf
package cn.itcast.day06.demo03;
/*
如何获取数组的长度,格式;
数组名称,length

这将会得到一个int数字,代表数组的长度,
数组一旦创建 程序运行期间,长度不可改变
 */
public class Demo03ArrayLength {
    public static void main(String[] args) {
         int [] arrayA = new int[3];

         int [] arrayB = {1,1,1,676,3,343,343,434,343,434,3,4};
         int len = arrayB.length;
        System.out.println("shuzu"+ len);

        int []arryC = new  int[3];
//        int len = arrayB.length;
        System.out.println(arryC.length);
        arryC = new  int[9];
        System.out.println(arryC.length);
    }
}

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-06
  • 2022-01-26
  • 2021-07-18
  • 2022-01-27
  • 2021-12-28
  • 2021-12-28
猜你喜欢
  • 2021-05-24
  • 2021-06-09
  • 2021-08-19
  • 2021-10-25
  • 2022-01-15
  • 2021-07-04
  • 2021-11-24
相关资源
相似解决方案