public String toString() {
return "(" + data + ")";
}
You're problem is here. toString()
is returning the memory references of data
and its contained elements. You can either use Arrays.toString(data)
inside this method to get a string representation of the items in the array, or in your method that is printing out the data, do something like this:
for(int i = 0; i < data.length; i++){
println(data[i]);
}