Hi marc/james,
Where good question.
interface MyInterface
{
------
};
class A implements MyInterface
{
-------
};
public class
Test {
A obj = new A();
MyInterface iface; // Reference
iface = obj;
};
Here in this piece of code, iface is a reference to object of class B. So you are using an extra indirection to access methods. This is to Achieve one type of runtime
polymorphism in
Java.
But this is not the case when we use abstract classes.
Regards, Raghav.