Could not finish Coffee/Beverage object topic


I could not get what to add to constructor and what use Coffere class or Beverage class as shown on example?


Is it step 3 that you are talking about, this one:

Modify the Coffee class so that it inherits from the Beverage class.


I think it works. I have some problem with hash map. Do you have any suggestion where could i look how hash map work? I mean what is the source to take a look on the working hash map code?


I've just started learning Java with this course so I have not yet had a chance to gather any extra resources. I found a lot of sites with a quick Google search for: java hashmap example


This works

class Coffee extends Beverage{

public Coffee() {


public void addSugar(int cubes) {

	System.out.println("You added " + cubes + " sugar cubes.");


public static void main(String[] args) {
Coffee myOrder = new Coffee();