+ 1

Java: Why isn't my return working? Please help.

public class Numbers //Part B { public static void main(String[] args) { int ten = 10; int five = 5; int result = 0; sum(ten, five, result); difference(ten, five, result); product(ten, five, result); System.out.println("10 * 5 is " + multiplyMainVars + "."); } public static void sum(int num1, int num2, int addMainVars ) { addMainVars = num1 + num2; System.out.println("10 + 5 is " + addMainVars + "."); } public static void difference(int NUM1, int NUM2, int subtractMainVars ) { subtractMainVars = NUM1 - NUM2; System.out.println("10 - 5 is " + subtractMainVars + "."); } public static int product(int diez, int cinco, int multiplyMainVars) { multiplyMainVars = diez * cinco; return multiplyMainVars; } }

13th Aug 2018, 12:37 PM
Fleet
Fleet - avatar
1 Odpowiedź
+ 2
Fleet post your code using the plus icon on your post and ill be happy to look through it and help
13th Aug 2018, 3:37 PM
StealthyTaco
StealthyTaco - avatar