Confusion with 8/12


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? error: incompatible types: void cannot be converted to int
System.out.println(myNumber = 123 * 456);
1 error

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


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.



Thank you my dude. Helps a lot!


No problem! Happy coding! :smiley:


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