"How is this normally done in Java?" "Painfully." lol as a Java developer I have to +1 you for that
–
TheLQJul 26 '11 at 6:16

Using a compact immutable struct-like class is not so painful... It is really like writing a C struct...
–
GuillaumeJul 26 '11 at 14:34

1

@Guillaume - sure, but all those little things add up in both time and space. I don't know why the Java community hasn't adopted a standard set of generics like "class Pair<T1,T2> { public T1 first; public T2 second; ... }"; in modern languages you just "return a, b" ; and then write "x,y=f()";
–
kevin clineJul 26 '11 at 14:55

I'm sure some 'ancient' language are able to do it too :) IMHO I found multiple return values can lead to total mess, and if you need to add another return fields, you just have to update your struct like class without to change your method signature.
–
GuillaumeJul 26 '11 at 15:24

That "Painfully." struck me hard, yes its exactly what I feel as Java developer when I meet similar situations.
–
artjomSep 25 '13 at 10:19