How do I return an array of objects in java?
Answers posted earlier solves your problem perfectly ... so just for sake of another choice .. i will suggest you to use List : may be ArrayList so it could go as :
List
ArrayList
public List getListOfObjects() { List arrayList = new ArrayList(); // do some work return arrayList; }
Good luck;