Java for Beginners(Collections)

 

               

Java Collections
 

collections: group of data Object that gathered together

            java Collections  : 

  • it's a utility framework for store and manipulate group of Objects 
  • it simplifies some basic and necessary operations and provides necessary data structures ,that required for complex logic building and development.

Collection Hierarchy  

   Collection <<Interface>>:

                  -   Collection interface builds the foundation on which the collection                         framework depends.

                       -  Its implemented by all the Collection Classes in the Collections                             framework.

                  - Its declare methods that every Collection class have.

    Iterator <<Interface>>:

                 - Iterator Interface is used for Iterate elements in forward direction Only.

    List <<Interface>>:

                  -It inhibits List data structure.

                      - It follows Insertion Order.

                      - It Allows duplicate Objects.

   Set <<Interface>>:

                -Set Interface Doesn't allow Duplicate values.

                    - Its element Order is based On hash Indexing (Object.hashCode():int).

    Map <<Interface>>:

                        - Its Stores the elements in key and value pairs.

                        - Its a Unordered Collection.

  Queue <<Interface>>:

                    - It follows Insertion Order.

                           - It Allows duplicate Objects.

                           - Its Follows (FIFO) First In First Serve.

   ArrayList :

                    Data Structure: Growable Array.

                          Characteristric: - stores Duplicate element.

                                                   - retains insertion order.

                                                         - Store multiple null value.  

                                                   - Suitable for random Access.  

 

    LinkedList :

                    Data Structure: Doubly Linked List.

                            Characteristric: - stores Duplicate element.

                                                    - retains insertion order.

                                                         - Store multiple null value.  

                                                   - Suitable for frequent Insertion.  

    Vector :

                    Data Structure: Stack.

                            Characteristric: - stores Duplicate element.

                                                    - retains insertion order.

                                                         - Store multiple null value.  

                                                   - Suitable for frequent Insertion.

 

 

 

 

 


Comments