+ 2
What are the various ways to take multiple return values from a method in JAVA?
Ex : return x,y;
1 Odpowiedź
+ 2
pass in a container, I believe this pattern is known as the wrapper.
class WrappedInts{
int a,b,c;
}
void modInts(WrappedInts w) {
w.a = 4;
w.b = 2;
w.c = 1;
}