I'm new to Java and I'm trying to figure out how I would write a math expression that displays the values of the variables on one line, then on the next line does the math?
Here is what I thought would work, but it just prints out the answers instead of the string representations on the top line of the addStuff() method.
public class DoSomeMath {
int num1C = 3;
int num1A = 7;
public void addStuff(){
//Show the Equation//
System.out.println("Adding num1C + num1A: " + Integer.toString(num1C) + Integer.toString(num1A));
//Show the Answer//
System.out.println("Adding num1C + num1A: " + num1C + num1A);
}
}