Null Array Dynamic nature

I wanted to know how int[] indices = null works cause it is like making an array without mentioning the size and you can keep on adding the elements to it.

So it is almost like creating a dynamic array.
Am I thinking wrong? Pls clarify.

hey @code_breaker-1001 as you should know that when we use int[] indices statement.Indices contains the address of that array but since you have given here null then there is no reference as to which indices is pointing therefore if you try to add or modify something in it say for eg : indices[2] there will not be any element in indices so you will get a error.
int[] indices = null;
This statement is futile.

ohk Can you also explain how indices is working here… We point it towards null then it it pointing towards allindices function but we do not give a specofic size or anything but when we insert values in indices using count it does not show error. I want to understnad the working here.

I got it. Thank You…

@code_breaker-1001 if you still have any doubt add it here.

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.