MCQ Practice Single Best Answer Topic: Array in Java

Q In Java arrays are

Question ID
#2196
Subchapter
Array in Java
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A objects
  • B object references
  • C primitive data type
  • D None of the above
Correct Answer: A

Explanation

In Java, arrays are objects. This means they are instances of the Object class, and their properties can be accessed through methods that apply to all objects. They store elements of a specific data type (like int, char, String, etc.), and their size is fixed once they are created.

Explanation:

  • Option A: objects (Correct) Arrays in Java are actual objects, regardless of the type of elements they store. This is why you can access array methods like length, and arrays are stored in heap memory.

  • Option B: object references While individual elements of an array might be object references (if the array contains objects), the array itself is not just a reference but an actual object.

  • Option C: primitive data type Arrays are not primitive data types. Primitive data types in Java are int, char, boolean, double, etc.

  • Option D: None of the above This option is incorrect, as arrays are indeed objects in Java.

Share This Question

Share this MCQ with your friends or study group.