Doubt in lecture

array is primtive datatype Or not… if not then where it store

@mayanktiwari6957,

An array in Java is an object.

In Java, we can create arrays by using new operator and we know that every object is created using new operator. Hence we can say that array is also an object.

In Java, there is a class for every array type, so there’s a class for int[] and similarly for float, double etc.

In Java, arrays are objects, therefore just like other objects arrays are stored in heap area. An array store primitive data types or reference (to derived data) types Just like objects the variable of the array holds the reference to the array.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.