The type of object you are trying to iterate is checked at compile time. And at compile time, the only information available is the declared type of the variable. The compiler cannot [reliable, always] find out that you are actually putting String [] there (google "stopping problem" to find out why).
Runtime-type information is used for polymorphism, such as casting, perhaps other things that I can't think of right now.
source share