Can somebody tell me why the value returned is 3 and not 8. Doesn\'t the return x statement from the addFive method change the value of x
return x
addFive
x
Because you're simply not using the computation of your function. It doesn't change value of x, it returns new value.
You should do something like:
int y = addFive(x);