Hey Roy, how you doing? That's a hard question, but i'll try to explain it...
We know that
ArrayList al, can refers to any
ArrayList, or any Subclass of
ArrayList. We also know that
ArrayList dont implements the interface [EMAIL]Map[/EMAIL]. BUT, we dont know if any of its subclasses do. We could have the following situation:
As the compiler can't know at compile time what
ArrayList al is really refering to (becouse of the
polymorphism), it compiles just fine...
PS.: if you really try to extend ArrayList and implements Map at the same time, you'll get an error, but that's for a different reason, sometimes called (diamond problem).
Hope Helped.
Tks