Could not finish Coffee/Beverage object topic


#1

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


#2

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

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


#3

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?
thanks.


#4

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


#5

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();

myOrder.addSugar(2);
myOrder.isFull();
}
}