#8, what is it looking for?


#1



I don't understand what part I am getting wrong. I have stored several int variables as per the question and then I tried to print the variable they want (product). Where did I go wrong?


https://www.codecademy.com/en/courses/learn-java/lessons/introduction-to-java/exercises/math-1?action=resume

This is the error:

Did you multiply two integers? Remember, integers are whole numbers only.


public class Comments {
	public static void main(String[] args) {
		
	int sum = 34 + 113;
  int difference = 91 - 205;
  int product = 2 * 8;
  int quotient = 45 / 3;

		int myNumber = product
      
      System.out.println(myNumber);

	}
}


#2

Do you see this error when you run that code?

Arithmetic.java:21: error: ';' expected
		int myNumber = product
		                      ^
1 error

#3


I don't really see an 'error' this is what pops up .. I tried to take out the printing of the number and replace int product with int myNumber. That didn't work either.

public class Comments {
	public static void main(String[] args) {
		
	int sum = 34 + 113;
  int difference = 91 - 205;
  int product = 2 * 8;
  int quotient = 45 / 3;

	}
}

#4

On the panel to the right of your editor -- that's where you should see the error.


#5

That space was empty


#6

It should look like this:


#7

i had same confusion, trapped me for a while then find out the key is the semicolon.
try to add ; after product then you will see :wink:


#8

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