Java | Arrays | Question 1

Which of the following is FALSE about arrays on Java
(A) A java array is always an object
(B) Length of array can be changed after creation of array
(C) Arrays in Java are always allocated on heap


Answer: (B)

Explanation: In Java, arrays are objects, they have members like length. The length member is final and cannot be changed.

All objects are allocated on heap in Java, so arrays are also allocated on heap.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.