hi!
<code>
Object objArray = new float[20];//Perfect
Float fArray = new float[20]; //Error
</code>
Understanding on the behalf of instanceof
test:
Every array passes the instanceof test with the Object class.
Float[] flt = new Float[20];
System.out.println(flt instanceof Object); //prints true
System.out.println(flt instanceof Float); //No
System.out.println(flt[0] instanceof Float); //prints true
the reference to the array is itself Object as always but the elements can be instanceof any class if you write like this :
Object[] object1 = new Object[10];
Here obviously object1 passes the instanceof test with the Object and each element of the array may keep reference of Any object because Object reference can keep reference of any Object.
Nobody except Object reference can refer to Float[20], because "Float[20]" fails instanceof test with the Float.
I hope understanding the concept in this way helps you!
cmbhatt