. In an array, every element has the same a. subscript b. data type c. memory lo
ID: 3707692 • Letter: #
Question
. In an array, every element has the same a. subscript b. data type c. memory location d. all of the above 2. The operator used to create objects is C. new d. create 3. Which of the following correctly declares an array of six integers? a. int array[6]; nt ?.in [6] array; d.int array new int6] 4. The value placed within square brackets after an array name IS a. a subscript b. an index C. always an integer d. all of these 5. If you define an array to contain ten elements, then the subscript you can use is b. 10 C. 9 d. 8Explanation / Answer
1. ans:- a (data type)
Array is the collection of elements of the same data type.So answer is a.
2. ans:- c (new)
new operator syntax - Object obj = new Object();
3. ans:- d
This option is correct syntax for array declaration.
4. ans:- d (all of these)
As subscript of an array is always an integer and and value placed between square brackets is known as index.
So option d is correct option.
5. ans:- c (9)
As array index ranges from 0 to arraysize-1 , so highest array subscript for array of size 10 would be 9.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.