4/17/19

List -1 | Java Collections Framework Part -3


List is a java collection that is one of the java collection interface. it derives two classes.
1. ArrayList
2. LinkedList


List VS. Set

List:
-Allowing duplicate elements
-List is an ordering collection

Set:
-Doesn't allow any duplication
-Set in java doesn't maintain any order.


ArrayList Class
-Uses dynamic array for storing - algorithm
-Can contain duplicate
-not syncronized (It is not Thread safe, So It is lower performance)
-Maintain order
-Random access
-Manipulation slow because a lot of shifting needs to be occurred.

ArrayList has mainly two methods
-add() - Add the elements on ArrayList
-get() - get the elements from the ArrayList


LinkedList

LinkedList has two type
- Single Linked List
- Doubly Linked List (java has doubly linkesList)

LinkedList Class
-Uses doubly linked list to store the elements
-Can contain duplicate elements
-not syncronized (It is not Thread safe)
-Maintains insertion order
-No Random access
-Manipulation fast because no  shifting needs to be occurred.

No comments:

Post a Comment

About

Hi, I'm Najathi.
I've started entrepreneurial company, Twin Brothers.Inc.
One is self-funded & the other is venture backed. I also send a weekly. where I share relevent, curated links.

Every Week I Publish a short post on writing, publishing, or content of IT Related

Contact Form

Name

Email *

Message *