Hello,
I have some doubts with respect to arrays in
Java. (not the java.util.Arrays class).
(i) Whenever we construct an array using new operator, there has to be a constructor invoked at one point of time. But the constructor of the class (which is instantiated for the array of objects) is not called, eventhough its present.
Since arrays in Java are direct descendants of java.lang.Object class (JSL confirms that), it should atleast definitely invoke the constructor of java.lang.Object class right? But how come we get to know that? There is no Constructor in Object class as well.
If at all, there is a constructor present in Object class, that should be invoked during array construction. Is that right?
For a reference, you may please have a look at this
thread. (ii) From where the
length variable is being provided for the arrays ? As it is not present in java.lang.Object class.
TIA.
[ July 09, 2007: Message edited by: Raghavan Muthu ]