int  x = new int; x.getClass().getName() gives [I if(x instanceof Array) --> this gives error Class Array Not Found I have checked, class Array is in java.lang.reflect package what is class for array object and what is length ?
Joined: Mar 17, 2000
Eventhough arrays are objects, they are instantiated without the class name, which means they don't belong to any class as such. Since arrays are objects, x instanceof Object returns true. The java.lang.reflect.Array class provides static methods to dynamically create and access Java arrays. It is for a different purpose. Ajith
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Joined: Dec 05, 2000
Dear Ajith, if x is array, then (x instanceof Object) gives result true. Now it is clear to me. Still I have doubt about .length ? length is member of which class ? It has to be memeber of some class. x.getClass().getName() gives result [I , what is meaning of [I sujit [This message has been edited by Sujit Kurtadikar (edited January 17, 2001).] [This message has been edited by Sujit Kurtadikar (edited January 17, 2001).]