Answer to Question #550 in Java | JSP | JSF for Matt
Is there a collection data structure that I can use to hold and manipulate different types of objects (i.e. Vector)? I have been trying an Object array, however, it is extremely limited and doesn't seem to work right.
You can not use a vector or an array of objects of different types. It's possible only if they inherited from one class, and need to store an array or vector of objects of this class. So using an array or vector of objects - the only possible solution if you do not know what will be in this array. Try to build your code in different way if this solution doesn't fit .
No comments. Be first!