The Java Collections Framework has a data structure that should work for virtually anything you'll ever need to do. Want to keep a list that you can easily keep adding to? Want to find something by name? Want to create a list that automatically takes out all the duplicates? Sort your co-workers by the number of times they've stabbed you in the back? Sort your pets by number of tricks learned? It’s all here...
TreeSet
Keeps the elements sorted and prevents duplicates.
HashMap
Let's you store and access elements as name/value pairs.
LinkedList
Designed to give better performance when you insert or delete elements from the middle of the collection. (In practice, an ArrayList is still usually what you want.)
HashSet
Prevents duplicates in the collection, and given an element, can find that element in the collection quickly.
LinkedHashMap
Like a regular HashMap, except it can remember the order in which elements (name/value pairs) were Inserted, or it can be configured to remember the order in which elements were last
accessed.
The java.util package contains classes and interfaces that are useful for working with groups of objects.
The package also contains classes that are used to develop applications to manipulate date, time, and generating random numbers and so on.
It also contains a list of classes and interfaces to manage a collection of data in memory.
Collections FrameworkCollection Interface
List Interface
ArrayList class
Vector class
LinkedList class
Set Interface
HashSet class
TreeSet class
Map Interface
HashTable class
HashMap class
TreeMap class
Stack class
0 comments :
Post a Comment