OOP 13.Generalizations 13/13 (Help!)


#1

Even though i did what i am supposed to at the 1st step, after trying to solve the 2nd, it brought me back to the 1st one, asking "Did you create the myOrder object within the main method?"
Here is my code (solved for the entire exercise i believe):

public static void main(String[] args) {

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



}

}

Please help!


#2

I don't immediately see anything wrong.

How you can help yourself:
Read the instructions really carefully, does your code behave as described?

How you can help us help you:
Post all code, all files (preferably marked as pre-formatted text so that it's guaranteed to be intact)
Post link to exercise
Mention which step isn't being marked as complete


#3

Hi! I just deleted the code and started all over again with the same code and it worked... I guess it was a bug or something, because it is correct apparently :3 Thanks for the fast answer.


#4

having the exact same problem


#5

I would suggest then trying @anelfa spoke about ten months ago. Also, if you have a problem I would suggest just posting a new topic on the forum discussions instead of replying to a really old one.


#6

I was having the same problem. What I did was first creating the object and then applying methods on it, not all in one try. What I mean is that you first need to do step 1 to go ahead and do the rest.


#8

Yes This is correct. For some reason they randomly throw in these exercises where you have to do things one step at a time. I had the same issue until I deleted everything but the myOrder constructor and ran the code.
You do each step, then run, then proceed to the next.. otherwise it throws an error.

Rather frustrating since previous problems would produce errors if you didn't do all steps before running. :angry: :confused:


#9

The assignment has issues with it's settings


#10

thanks i faced the same problem and cleared it with the help of ur comment..:innocent:


#11

change class to" class Coffee extends Beverage {"


#13

I was able to resolve this error. Some tips on resolving it yourself:

1) Do the activity one instruction, one line at a time. Dont' get ahead of the instructions.

2) Watch out for trailing/extra spaces beyond the semi-colon. For some reason this sets off the error. I removed the trailing spaces and I got on fine.


#14

Dont' get ahead of the instructions.Do as per instruction wise.


#15