13/13 step 3

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

``` What does this mean and how do I do it? **Modify the Coffee class so that it inherits from the Beverage class.**
<do not remove the three backticks above>

Remember in the previous exercise we used the extends keyword on Dog to inherit the Animal class?

Well this is essentially the same thing.

We want to inherit the Beverage class’s attributes and methods because it has a method in there that makes sense to use for Coffee because coffee is-a Beverage.

Say we had another class similar to Coffee, but instead called it Water. We don’t inherit from coffee because coffee has addSugar(). That doesn’t make too much sense for water. But we can inherit from beverage as well and save on coding time because the method isFull() in side of the beverage class makes sense to use for the Water class.

Is that a little easier to comprehend or have I just made it more confusing for you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.