top of page

Java -Collection part -1 ArrayList

  • May 5, 2017
  • 1 min read

Collections in java is a framework that provides an architecture to store and manipulate the group of objects.

Collection represents a single unit of objects i.e. a group.

Collection framework represents a unified architecture for storing and manipulating group of objects. It has:

  1. Interfaces and its implementations i.e. classes

  2. Algorithm

Let'us Divide into collection from very Basic ............. how to create collection

Program to create collection and store it in list

Above Program show a very basic implementation of collection.

Know Lets dig more into it with some more examples

  • JAVA ARRAYLIST

Java ArrayList class uses a dynamic array for storing the elements. It inherits AbstractList class and implements List interface.

The important points about Java ArrayList class are:

  • Java ArrayList class can contain duplicate elements.

  • Java ArrayList class maintains insertion order.

  • Java ArrayList class is non synchronized.

  • Java ArrayList allows random access because array works at the index basis.

  • In Java ArrayList class, manipulation is slow because a lot of shifting needs to be occurred if any element is removed from the array list

Below is an implementation of ArrayList

Comments


Featured Posts
Recent Posts
Archive
Related Posts
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square

Subscribe for Code Deal Updates!

© 2017

bottom of page