It's a choice that Java designers have made: String[] extends Object[], but you can't add anything other than a String to an array whose concrete type is String[] without getting a runtime exception.
What they could have made invalid is the following:
Object[] ob = new String[1];
because it effectively allows any kind of object to be added to the array without getting any compiler error (as you noticed), which is perfectly normal since an Integer is an Object, and the compile-time type of the array is Object[].
They didn't make this choice for arrays, but they did it for generic collections:
List<Object> ob = new ArrayList<String>();
generates a compiler error, because List<String> doesn't extend List<Object>. Collections should generally be preferred over arrays, as they're safer, and provide a lot more functionality.
obis anObject[].Integeris a subclass ofObject. So that should compile perfectly fine. Perhaps you want to declareobasString[]instead?String[]) vs. the compile-time type of the array variable (Object[]). The compiler only enforces that what you put into the array is compatible with the static type of the array variable refering to it.