I agree with what Joe said and I would like to add my thoughts.
The following is your code:
The following is what I think you want to do.
In "new line 1", I only declare an array of objects. I don't instantiate the array since the array of objects reference variable, obj, is given a value in line 2.
In "new line 2", an object reference variable named, query, has a method named list() that returns an object that has a method named toArray() that instantiates an array with the same elements as query.list().
In "new line 3", you are using the for-each loop that came out with the Java Language version 5.0 and later. Here, the object reference variable will be assigned as each of the elements of the array called: obj.
In "new line 4", each value that was in the array of objects is converted to a
String. The output that you are seeing is the result of the method of the class String called toString().
Like Joe answered, you need to override the method toString() for the objects that are in the query.list().\
[ January 15, 2008: Message edited by: Kaydell Leavitt ]