hi
i have created a class called Tuple that simply has two variables in it that are defined when the class is created. what i want to do now is add a function to the class that is called compare.
i want this function to compare an array of Tuples and then return one from that array.
i know i can call a function on a single instance but how am i able to make that function callable from the array
this is what i have so far
public class Tuple { int x; int y; public Tuple(int a, int b) { x = a; y = b; } }
i have this right but i want to be able to call the function compare() this so
Tuple[] tupleArray = new Tuple[2]; //add stuff to tupleArray Tuple newTuple = tupleArray.compare();
thanks in advance