13/13

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

Step 1.
Inside of the main method, create a new Coffee object called myOrder.
Question
Did you create the myOrder object within the main method?

Hmm I don’t see anything immediately wrong… Is this still causing errors for you?

As far as I can see this exercise is broken. There seems to be quite a few threads about this. I have tried;

Coffee myOrder = new
Coffee myOrder = new Coffee();

Getting really frustrating now

@owenb94
Have you tried a refresh Browser

Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).

3 posts were split to a new topic: I’ve tried all you hints and tips guys but it does not let me pass on this lesson

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

}

}
// it is working for me, try to refresh browser. Good luck!

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