Confusion with 8/12


#1



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?


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);


#2

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);

#3

Thank you my dude. Helps a lot!


#4

No problem! Happy coding! :smiley:


#5

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