14-03-25 ---------- Java Collection Framework ----------------------------- Q)How to create a group of objects in Java? 1)using an array 2)using a collection Q)What are the limitations of arrays in dealing with a group of objects? 1)size is fixed once created(i.e. an array is neither shrinkable nor growable) 2)API support(library support) is missing to deal with the group of objects =>Because of the lack of resizable nature of an array, either memory will be wasted or memory will not be sufficient in the application. =>If we use an array to represent a group of objects(collection of objects), we need to write lot of logic for storing,deleting, updating and retrieving of objects. Note:- collections overcome the limitations of arrays. Q)What is a collection ? =>A collection is a Java object that stores other Java objects. =>A collection is a group of objects that is treated as a single entity. Q)What is the theme of collection framework? =>Dealing with application objects in an object oriented manner is the theme of Java collection framework. =>whenever we need to perform CRUD operations on application objects, collection framework is the solution. C- CREATION(INSERTION/STORING) R- RETRIEVAL U- UDATION D- DELETION Q)What is Java collection framework? =>Java collection framework is a unified architecture for representing and manipulating a collection of (group of) objects. =>Java collections framework consists of three things. 1)interfaces 2)implementation classes 3)Algorithms Q)How are collections classified? 1)list based collections 2)set based collections 3)map based collection =>java.util.List interface is used to represent list based collections. =>java.util.Set interface is used to represent set based collections. =>java.util.Map interface is used to represent map based collections