An error message is appearing while my code is correct and console is showing output too! :(


#1

strong text<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.>

https://www.codecademy.com/courses/learn-java/lessons/object-oriented-programming/exercises/generalizations-oop-java?action=lesson_resume

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

My code was correct and console is showing output too but an error message is appearing which is :

           _Did you create the myOrder object within the main method?_

``` **This is the main() function(method) of class coffee**

. public static void main(String[] args) {

Coffee myOrder = new Coffee();
myOrder.addSugar(10);
myOrder.isFull();

}

}

<do not remove the three backticks above>

#2


I have the same problem.


#3

hey, I am sure there is some problem with codecademy’s compiler.
So bro don’t worry.
Just keep on pressing run button. After a while an alert will pop up with two buttons, which are Keep trying or Get code. Press get code and then you will be allowed to proceed to the next exercise.


#4

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