How to return more than one value from a function in Java? Can anyone give sample code for doing this using tuples? I am not able to understand the concept of tuples.
You can return an array from a java function:
public static int[] ret() { int[] foo = {1,2,3,4}; return foo; }