Using interfaces in java..Newb question

Posted by Rahul on Stack Overflow See other posts from Stack Overflow or by Rahul
Published on 2010-05-04T18:41:43Z Indexed on 2010/05/04 18:48 UTC
Read the original article Hit count: 255

Filed under:

Suppose there in an interface Displaceable and a class Circle which implements Displaceable. Displaceable has a method named move() which of course is implemented in Circle.

What would happen in the following scenario?

Circle a =  new Circle(..);
Displaceable b = a;
b.move()

Would the object refer to the Circle's move method?

© Stack Overflow or respective owner

Related posts about java