Stephan van Hulst wrote:An array is a subtype of Object.
Every type in Java, except for the primitives (boolean, int, float, char, etc.) are subtypes of Object.
I know 'String' is a class hence is a subclass of 'Object' , I also know 'Arrays ' is class so its a subclass of Object but when we declare an array with '' how is it possible that it could be a subclass of the Object ???
Stephan van Hulst
Joined: Sep 20, 2010
Because that's what the language designers decided. All arrays are subtypes of Object.
Try the following line: System.out.println(nums instanceof Object);