Whenever we create an object(Any object),an Constructor for that class is called.
It is also mentioned in books that "any code that that uses the keyword new,will(if it runs successfully) cause the class constructor and all superclass constructors to run."
Now, my Question is:
An array is also an object and always created on heap,now when we create an array object(means array of reference or of primitives) then is any constructor called? if yes ,which?
Thanks and regards,
Kunal.
It is also mentioned in books that "any code that that uses the keyword new,will(if it runs successfully) cause the class constructor and all superclass constructors to run."
Now, my Question is:
An array is also an object and always created on heap,now when we create an array object(means array of reference or of primitives) then is any constructor called? if yes ,which?
Thanks and regards,
Kunal.