What is Collections in Java………

Collections are an interface in the java.util package, and as its name suggests, it is used to define a collection of objects. There are many different classes which implement the collections interface. Each one has its unique features, some add elements in a sorted manner, others in a binary fashion. But there are two basic structures, a map and a list and most others extended these interfaces.

Collections are objects whose sole purpose is to store other objects, like arrays. Unlike arrays, however, collections have convenience methods to, say, return a portion of the original collection. A drawback of collections is that they can’t hold primitives. (They can, however, hold wrappers, like java.lang.Integer.)

All collection objects ultimately implement the java.util.Collection interface. However, few if any implement the interface directly. There are multiple sub-interfaces of Collection that specify additional methods. These sub-interfaces decide the functionality of a collection; individual classes usually differ only in implementation. (For example, both ArrayList and LinkedList fulfill the general contract of theList interface, but do so differently.)

Most implementations of the Collection interface are in java.util. Exceptions will be noted when introduced.

Although the Map interface does not extend Collection, it is usually included in discussions of collections and will be explained here.

Share the knowledge




Advertisements

About Dinesh

I am engineering student........ I am selected in Microsoft Student Partner as MSP............

Posted on September 25, 2010, in Java. Bookmark the permalink. 1 Comment.

  1. t8i5Y4 ivobetlsoixk, [url=http://vmrzuacaszts.com/]vmrzuacaszts[/url], [link=http://ebemeikluhvv.com/]ebemeikluhvv[/link], http://ojyibdxlfenv.com/

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: