I have trouble understanding the return types of a method in java. Where is it supposed to be? On the stack or heap? Let's take this example snippet:
/** the snippet returns the minimum between two numbers */
public int minFunction(int n1, int n2) {
int min;
if (n1 > n2){
min = n2;
}else{
min = n1;
return min;
}
}
how and where are minFunction, n1, n2, min stored in memory. if i call the method with the numbers 3 and 5 what will happen?