posted 20 years ago
The type of the variable "i" doesn't matter at all. All that matters is the type of the object it points to, which is class B. Just remember that "instanceof" is evaluated at runtime.
An instance of B is an instance of A because B extends A.
A B is a B, of course.
A B is an I1 because A implements I1, and B extends A.
And a B is an I2 because B implements I2.