Question: For questions in my Java Programing class, I need to answer the following questions which I am not sure if I answered right: int[] num

For questions in my Java Programing class, I need to answer the following questions which I am not sure if I answered right:

int[] num = new int[100];

for(int i = 0; i < 50; i++)

num[i] = i;

num[5] = 10;

num[55] = 100;

1) How many components are in the array above?

(a) 0 (b) 99

(c) 50 (d) 100

2) What is the index number of the last component in the array above?

(a) 0 (b) 100

(c) 99 (d) 101

3) What is the value of num.length in the array above?

(a) 0 (b) 100

(c) 99 (d) 101

4) What is the value in index 10 of the array above?

(a) 0 (b) 10

(c) 5 (d) 50

5) Which of the following is the array subscripting operator in Java?

(a) . (b) new

(c) { } (d) [ ]

6) Assume that two arrays are parallel. Assume the first array contains a persons id number and the second contains his or her age. In which index of the second array would you find the age of the person in the third index of the first array?

(a) 1 (b) 2

(c) 3 (d) It cannot be determined form the information given.

char[ ][ ] array1 = new char[15][10];

(7) How many dimensions are in the array above?

(a) 0 (b) 2

(c) 1 (d) 3

8) How many rows are in the array above?

(a) 0 (b) 10

(c) 2 (d) 15

9) How many columns are in the array above?

(a) 0 (b) 10

(c) 2 (d) 15

10) What is the value of array1[3].length ?

(a) 0 (b) 10

(c) 2 (d) 15

11) What is the value of array1.length ?

(a) 0 (b) 10

(c) 2 (d) 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!