MCQ Single Best Answer Not Set

QIn Java arrays are

ID: #2196 Array in Java 2,424 views
Question Info
#2196Q ID
Not SetDifficulty
Array in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A objects
  • B object references
  • C primitive data type
  • D None of the above
Correct Answer: Option 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.

No Previous Next Question

Share This Question

Challenge a friend or share with your study group.