2
void exampleFunction(int a, int b)
{
    int c=sum(multiply(a,b),c);
}

While debugging this exampleFunction, is there a way i can check the return value of multiply(a,b) function at run time. I do not want to put any System.out.println statements. Suggest a way while debugging code in android studio.

4

2 回答 2

9

This is a common question for whoever starts from zero. It's not hard, so follow these steps and you will reach it.

Step 1: add breaking point at

int c=sum(multiply(a,b),c);

Step 2:debug it and stop at breaking point

Step 3:right click and you will see

enter image description here

Click "Evaluate Expression"

Step 4: input multiply(a,b)

Done! Congratulations!

于 2016-06-13T14:04:49.053 回答
1

I just found another way also, we can also click on add watch and directly put the function multiply(a,b), it will keep on showing that result in watches whenever that function and "a,b" are in scope

于 2016-06-13T14:17:38.320 回答