Did you create the `myOrder` object within the `main` method? Where m I wrong?


#1

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

}

}


#2

me too......i got stuck here too....can anybody kindly help us?


#3

I just finished this one lads. First do one step at a time, I find it less glitchy.

First do Coffee myOrder = new Coffee(); then press RUN
Then do myOrder.addSugar(2); then press RUN again

then extend the class, by doing public Coffee extends Beverage press RUN

then finally do myOrder.isFull(); and press RUN.

This is how it worked for me, I could NOT proceed when I asked to "Getcode" , but doing this made every step green one at a time and I made it through. Good luck


#4

thx it worked i guess you just can't either do all of them in one go or press get code :stuck_out_tongue:


#5

Yes this works.... Thanks alot buddy


#6

Thankkk you so much! It really helped!


#7

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