Java Programming Multiple Choice Questions - Array

This section focuses on the "Array" of the Java programming. These Multiple Choice Questions (mcq) should be practiced to improve the Java programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1.Which of these operators is used to allocate memory to array variable in Java?

A. malloc
B. calloc
C. new
D. new malloc

View Answer

2. Which of the following is FALSE about arrays on Java

A. Arrays in Java are always allocated on heap
B. Length of array can be changed after creation of array
C. java array is always an object
D. None of the above

View Answer

3. Which of these is necessary to specify at time of array initialization?

A. Both Row and Column
B. Column
C. Row
D. None of the mentioned

View Answer

4. In java array object are

A. objects
B. primitive data type
C. object references
D. None of the above

View Answer

5. Which of these is an incorrect array declaration?

A. int [] arr = new int[5].
B. int arr[] = new int[5].
C. int arr[] = new int[5].
D. int arr[] = int [5] new

View Answer

6. When you pass an array to a method, the method recieve

A. copy of the array.
B. The length of the array.
C. The reference of the array.
D. copy of the first element.

View Answer

7. Which will legally declare,construct, and initlaize an array?

A. int myList [] [] = {4,9,7,0};
B. int [] myList = (5, 8, 2);
C. int [] myList = {};
D. int myList [] = {4, 3, 7};

View Answer

8. Generics does not work with?

A. Tree
B. Set
C. List
D. Array

View Answer

9. Where is array stored in memory?

A. heap space
B. first generation memory
C. stack space
D. heap space and stack space

View Answer

10.An array elements are always stored in ________ memory locations?

A. Random
B. Sequential
C. Sequential & Random
D. Binary search

View Answer

Also check :


* You must be logged in to add comment.