Confusion with 8/12

<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.>
I’m extremely confused with 8/12. I don’t know where to drop in the variables for this exercise. I’m really new at Java, so I kind of expected to be bad at it. Someone please help?

<In what way does your code behave incorrectly? Include ALL error messages.>
Arithmetic.java:5: error: incompatible types: void cannot be converted to int
System.out.println(myNumber = 123 * 456);
^
1 error

```

System.out.println(myNumber = 123 * 456);

<do not remove the three backticks above>

Ok so the instructions say 1.
Set the int variable myNumber equal to the product of two numbers.

So in following these instructions your basic format should be:

int myNumber = 123 * 456;

The examples also show using int so it is not hard just got to understand that using int is the key to setting up the variable. Then inside the system.out.println you just need myNumber no equation.

System.out.println(myNumber);
1 Like

Thank you my dude. Helps a lot!

1 Like

No problem! Happy coding! :smiley:

1 Like

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