Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
I assume that with "object" you mean "reference type". Remember that primitive types are also objects. To the question: Arrays are reference type objects. Arrays can contain values of reference type. This can be proved by passing an array into a function as an argument, by changing the argument in the function call, the changes will affect the original array outside the function call. This wouldn't work for primitive datatypes. This means that the value that was passed as argument is just a reference to the array. The actual values are stored somewhere else.
17th Oct 2019, 2:18 PM
Seb TheS
Seb TheS - avatar