• 2022-06-06
    看下面的数组定义:int[] numbers = new int[50];a) 数组有多少个元素?b) 数组中第一个元素的索引是多少?c) 数组中最后一个元素的索引是多少?
  • (1)50(2)0(3)49

    内容

    • 0

      若定义“int a[30][50];”,则数组元素a[10][40]前有 个数组元素

    • 1

      声明一个数组int[][]arr=new[3][5];该数组中共有()个元素。 A: 9 B: 10 C: 15 D: 12

    • 2

      Look at the following array definition: 看看下面的数组定义: [br][/br]int[] bigNumbers = new int[50]; [br][/br]How many elements does the array have? 数组有多少个元素?[br][/br] Answer: ____。[br][/br]What is the index of the first element in the array? 数组中第一个元素的下标是多少?[br][/br] Answer: ____。[br][/br]What is the index of the last element in the array? 数组中最后一个元素的下标是多少?[br][/br] Answer: ____。

    • 3

      有一个整型数组int[] array = new int[]{1,2,3,4}。通过索引访问该数组,当索引为2时,得到的结果是多少?

    • 4

      如果有以下定义:int[][] Arr = new int[3][]; Arr[0] = new int[] { 10, 20, 30 }; Arr[1] = new int[] { 40, 50, 60, 70 }; Arr[2] = new int[] { 80, 90 };,则对数组Arr说法不正确的是() A: Arr是二维交错数组,共包括9个元素。 B: 可以使用Arr[1,2]引用数组中的一个元素。 C: 可以使用Arr[1][2]引用数组中的一个元素。 D: 由于Arr数组的每个子数组大小不一致,所以必须采用分层创建的方法。