Results 1 to 4 of 4
- 08-10-2010, 07:14 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 1
- Rep Power
- 0
- 08-10-2010, 07:39 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 08-10-2010, 09:02 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
And also think really, really hard about whether you actually want to be doing this...and think whether you could write a class that would better represent the data going into the Vector, and make it a Vector<MyClass> instead.
Mixing datatypes in a Collection is usually a recipe for bugs.
- 08-10-2010, 09:33 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
I've used it once: a Map<String, ?> where the key represents a logical name and the value either is the class name to load or an instance of such a class in which case the object is 'cacheable', i.e. there's only one instance of it.
Most of the time such collections end up as the recipient for ResultSets or similar; they're indeed a source of trouble ...
kind regards,
Jos
Similar Threads
-
help for collection api
By javastuden in forum New To JavaReplies: 3Last Post: 02-24-2010, 11:52 AM -
collection framework
By swati.jyoti in forum New To JavaReplies: 8Last Post: 09-01-2009, 03:45 PM -
How to get NamingEnumeration from my collection?
By hencre in forum Advanced JavaReplies: 1Last Post: 10-18-2008, 08:01 PM -
persistent collection
By nanaji in forum Advanced JavaReplies: 4Last Post: 10-03-2008, 04:40 PM -
how to creat collection
By STILET in forum Advanced JavaReplies: 2Last Post: 07-29-2008, 07:17 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks