Hello
I was wondering, if I have an interface that is implemented by several classes, (lets say Shape)
and I've created an object of this type like this
Shape s;
s = new Rectangle();
// after few method calls I change the type of s to be triangle
s = new Triangle();
then how can I determine what type of shape s in this case? in other words, how can I know if s is now a triangle or rectangle?
is there a method in
Java that checks the actual type of the object?
Thanks
HannaH