Tag: data structures and algorithms in java

Java Collections API Methods

August 11, 2011 · 6 min read
A small confusion comes to a novice at this juncture between **collection** and **collections**. Both are very different. Collection is an interface and Collections is a class, both from **java.util** package. [Collection is the root interface](http://way2java.com/collections/java-interface-collection/) from which almost all data structures are derived, commonly known as [collection framework](http://way2java.com/collections/java-collections-framework/). **Collections** class contains many [static methods](http://way2java.com/oops-concepts/static-keyword-%e2%80%93-philosophy/) with which data structures manipulation becomes easier. I can say only word: Collections class is a boon (gift by the designers) to data structures which you too accept when you go through all the example codes given here under. I say boon because the lots of trouble you encountered with laborious coding of loops in C/C++ to manipulate DS elements is overcome with a simple method call. This is the best place to prove Java is simple language to practice.