Q. Which of the following statements is true about arrays in Java?

  • (A) Arrays can change in size after initialization.
  • (B) Arrays can store elements of different types.
  • (C) Arrays can have a negative length.
  • (D) Arrays are objects of type Array.
πŸ’¬ Discuss
βœ… Correct Answer: (D) Arrays are objects of type Array.
Explanation: In Java, arrays are objects. They are instances of classes that extend the abstract class java.lang.Object. However, arrays in Java are implemented as objects of a specific type called "Array". This means that arrays in Java are indeed objects, but they are not instances of the Array class; rather, they are instances of classes that are automatically generated by the Java Virtual Machine (JVM) when arrays are created.
Explanation by: Sonali Mishra
In Java, arrays are objects. They are instances of classes that extend the abstract class java.lang.Object. However, arrays in Java are implemented as objects of a specific type called "Array". This means that arrays in Java are indeed objects, but they are not instances of the Array class; rather, they are instances of classes that are automatically generated by the Java Virtual Machine (JVM) when arrays are created.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
278
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Sonali Mishra
Publisher
πŸ“ˆ
91%
Success Rate