Question: Given the method f 2 ( ) below, what does f 2 ( 4 , 2 ) return? public static int f 2 ( int

Given the method f2() below, what does f2(4,2) return?
public static int f2(int a, int b){
if (b >=1)
return f2(a +1, b -1);
else
return a;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!