Pages

Collections in Java

Collection (I) :
  • A group of individual objects as a single entity.
  • Collection interface defines the most common methods which are applicable for any collection object
  • In general collection, interface is considered as Root Interface of collection framework
  • There is no concrete class which implements Collection interface directly
Java Collections
Java Collections

Collection Framework: Several classes and interfaces which can be used to represent a group of objects

Following are Legacy characters present in Collection Framework:
  1. Enumeration(I)
  2. Dictionary(AC) [AC -> abstracct Class]
  3. Vector(C)
  4. Stack(C)
  5. Hashtable(C)
  6. Properties(C)
Collections:
  • It is a utility class present in java.util package
  • Collections class defines several utility methods for collection objects like sorting, searching, reversing, etc.,.
ex:     Collections.sort(al);
         Collections.reverse(al);    // where al --> arraylist


Please comment below to feedback or ask questions.

No comments:

Post a Comment

Please comment below to feedback or ask questions.