> For the complete documentation index, see [llms.txt](https://cs61b-2.gitbook.io/cs61b-textbook-2025/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs61b-2.gitbook.io/cs61b-textbook-2025/9.-inheritance-i-interface-and-implementation-inheritance/9.5-implementation-vs.-interface-inheritance.md).

# 9.5 Implementation vs. Interface Inheritance

### Interface Inheritance vs Implementation Inheritance <a href="#interface-inheritance-vs-implementation-inheritance" id="interface-inheritance-vs-implementation-inheritance"></a>

How do we differentiate between "interface inheritance" and "implementation inheritance"? Well, you can use this simple distinction:

* Interface inheritance (what): Simply tells what the subclasses are able to do.
  * EX) all lists should be able to print themselves, how they do it is up to them.
* Implementation inheritance (how): Tells the subclasses how to implement their behavior.
  * EX) Lists should (by default) print themselves exactly this way: by getting each element in order and then printing them.
