对于下面的代码,从Calculator main方法调用Add方法,传递的数据是1,2。我需要在方法调用之间传递数据。我能够得到调用图。任何人都可以帮助我如何在java中获取中间数据 屏幕截图 - http://i.imgur.com/MAgdD0y.jpg
package dr;
public class Calculator {
public static void main(String args[]){
Addition ob1 = new Addition();
Multiplication ob2 = new Multiplication();
int result1 = ob1.Add(1, 2);
int result2 = ob2.Multiply(2, 4);
System.out.println(result1);
System.out.println(result2);
}
}
class Multiplication {
public int Multiply(int[enter image description here][1] a, int b){
return a*b;enter image description here
}
}
class Addition {
public int Add(int a, int b){
return a + b;
}
}