Is there a more efficient way passing object parameters in recursion?
问题 I would like to do recursion in Java, passing object parameters. Something like this: int recursion(Object object) { //do a little bit modification to the object int i1= recursion(modified_object_1); //do a little bit modification to the object int i2= recursion(modified_object_2); //do a little bit modification to the object int i3= recursion(modified_object_3); return max(i1, i2, i3); } Now, because objects are passed by reference, I have to clone the object parameters 3 times and pass the