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. Java array is a collection of ________.

A. similar type of elements
B. different type of element
C. heterogeneous data
D. Both A and C

View Answer

2. Array data access using _____.

A. Operator
B. Variable
C. index
D. Pointer

View Answer

3. At time of array initialization which is necessary to specify?

A. Row
B. Column
C. Row and Column
D. None of the above

View Answer

4. Java Array can allocate __________.

A. Dynamic Memory
B. Static Memory
C. Both A and B
D. None of the above

View Answer

5. Which of the following 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. Index in array start with ______.

A. -1
B. 0
C. 1
D. infinite

View Answer

7. Which of the following is used to declare,construct, and initlaize an array?

A. int arr [] [] = {1, 2, 3, 4};
B. int [] arr = (1, 2, 3);
C. int [] arr = {};
D. int arr [] = {1, 2, 3};

View Answer

8. We can calculate the length of an array using ________.

A. sizeof(array)
B. array.len
C. array.length
D. array.sizeof()

View Answer

9. Which of the following is advantage of java array?

A. Code Optimization
B. Random access
C. Size No-Limit
D. Both A and B

View Answer

10. In java, array elements are 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.