Collection Framework contains all Data Structures in Java. In this packet we will be looking at ArrayList, LinkedList and Stack.
Lets us talk about ArrayList in Java.
It is a part of the collection framework present in java.util package.
Here .add() is used to add elements in the Arraylist.
.set() is used to change the elements in the Arraylist.
.remove() is used to remove the elements in the Arraylist.
More methods are implemented in the code.
Let us talk about LinkedList in java.
It is also a part of collection framework present in java.util package.
It is a Linear Data Structure.
To add, change, remove same methods are used as we have discussed in Arraylist.
Let us talk about Stack in JAVA.
It is present in java.util package.
It is based on the principle of Last In First Out (LIFO) and is also said as an extended vector.
All the methods are discussed in the codes.
Submitted by Abhishek Vishwakarma (abhishek687)
Download packets of source code on Coders Packet