The notion of IS-A is independent of Java. Java types that extend a class or implement an interface have an IS-A relationship with the class or interface. If you implement Duck you're a duck; if you extend Duck you're a Duck. Simple.
Todd Farmer
Ranch Hand
Joined: May 28, 2004
Posts: 59
posted
0
Originally posted by Rick O'Shay: The notion of IS-A is independent of Java. Java types that extend a class or implement an interface have an IS-A relationship with the class or interface. If you implement Duck you're a duck; if you extend Duck you're a Duck. Simple.
In code, this would look like this:
It doesn't matter whether A is an interface that B implements, or whether B is a subclass of A. Regardless, B does eveything that an A can, so B is an A.