13/13 step 2 need help


#1


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

I am completely lost and cannot find how to do this in the previous steps.


class Coffee {
	
	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();
 int 2 = addSurgar.myOrder();
 
  }
  
}


#2

@anikin3562,
Your

int 2 = addSurgar.myOrder();

should be

 myOrder.addSugar(2);

Do a google search
== the Book ==
java class definition site:oracle.com
java creating object site:oracle.com


#3

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