Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regarding Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regarding Collections" Watch "Regarding Collections" New topic
Author

Regarding Collections

Mani Venkata Kanth
Ranch Hand

Joined: Aug 21, 2006
Posts: 39
hi,

pls...Anybody will summarize which collection should be used for the given
requirements
.???

Thanks for your replies
Praveen Babu
Ranch Hand

Joined: Jul 30, 2006
Posts: 138
Well, what are the requirements ?
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Originally posted by k pandu:
hi,

pls...Anybody will summarize which collection should be used for the given .???

Thanks for your replies


This seems to be a homework.. You tell us what are your requirements, then we may provide you the Optimum way out.. But if you are asking in General. Then you should first read out the Collection ownself..

Check out this link to get hands-on on Collection


1. Java Collection

2. Core JAVA Collections

3. Performance of Collections

Hope this helps you.


The Best way to predict your future is to create it - Every great individual common man
Mani Venkata Kanth
Ranch Hand

Joined: Aug 21, 2006
Posts: 39
which collections are suitable for the following requirements...

1.for uniqueness and sorted order
2.for uniqueness and unsorted order
3.duplicates with sorted order
4.duplicates with unsorted order
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Originally posted by k pandu:
which collections are suitable for the following requirements...

1.for uniqueness and sorted order
2.for uniqueness and unsorted order
3.duplicates with sorted order
4.duplicates with unsorted order


Seems to be a homework exercise.. At every page of Collections they have clearly mentioned which to be use according to condition given by you...

Take a look on the links I have mentioned for you..... There you will be get clear picture.
aparna maddukuri
Greenhorn

Joined: Aug 21, 2006
Posts: 3
I think this might solves u'r doubt

1.for uniqueness and sorted order-TreeSet
2.for uniqueness and unsorted order-HashSet
3.duplicates with sorted order-ArrayList
4.duplicates with unsorted order-LinkedList
bing marquez
Greenhorn

Joined: Aug 06, 2006
Posts: 11

I think this might solves u'r doubt

1.for uniqueness and sorted order-TreeSet
2.for uniqueness and unsorted order-HashSet
3.duplicates with sorted order-ArrayList
4.duplicates with unsorted order-LinkedList


The elements of an ArrayList are ordered by their index, they are not however sorted.
aparna maddukuri
Greenhorn

Joined: Aug 21, 2006
Posts: 3
I too a bit confused in writing.
what was the best collection suits for "duplicates with sorted order".
 
 
subject: Regarding Collections
 
Similar Threads
Heavy Raining in Mumbai
Help
Can I just learn some XML and say I know SOA?
Best Java Memory Aid Contest
Tech Word Game