Array are defined to be object in Java rather than primitive type. correct me if I am wrong.
Why is that array are initialize to 0 and not null, unlike other Java object.
Initialization of Array in Java
Hi Mohit,
Refer to thread give below:
Can we say when we say int[] arr; then arr stores a null value.
But when int[] arr = new int[length], then arr stores references(memory address) to first integer arr[0].
Yes you can say this.
Hi Mohit
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.
Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.