Java Object Orientated Lesson 13 Generalizations HELP!


#1



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


I have no idea what to do for the instructions. I have tried all sorts of codes putting it everywhere but I keep on getting errors. SOMEONE HELP ME PLEASE!!!

I've been putting myOrder.Coffee(); mainly and placed after the main in between the brackets


class Coffee {
	
	public Coffee() {

	}
	
	public void addSugar(int cubes) {

		System.out.println("You added " + cubes + " sugar cubes.");

	}

	public static void main(String[] args) {

	}
}

#2

To create an instance of Coffee use

Coffee myOrder = new Coffee();

Hope this is what you are looking for.


#3

Hey is that the good way to try
Coffee myOrder = new Coffe();

I think it possible to get the output


#4

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