Thanks a lot for the reply. But still the idea of implementing the anewarray instruction of jvm is not very clear. I went to the site suggested by Marlene Miller(thanks once again). I am reproducing some part of the description over there:-
1> The anewarray instruction creates an array of object references. This instruction allocates space for the array of object references and initializes the references to null.
2> pops length, allocates a new array of objects of class indicated by indexbyte1 and indexbyte2, pushes objectref of new array.
From the 1st point I understood that an array of object references has to be created, but if the references are initialised to null where and when the references will point to objects?
From the 2nd point I understood that an array of objects has to be created. Can anyone plz tell as to what exactly are we supposed to do b'coz the 2 statements mentioned above are quite contradicting ?