Linked List
The "LinkedList" in collection is used as an alternate solution to arrays to retrieve data as a list, where arrays are inefficient.
  • Arrays are stored with an index can be retrieved very fast from huge data storage. But inserting a data in the middle can pose a problem.
  • Listing is a faster option in this scenario
Example Code

import java.util.List;
import java.util.*;
import java.util.ArrayList;
public class Test_This {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
Process p1 = new Process();
class Process
String[] first = {"a","e", "c","b","d"};
public Process()
System.out.println("Default) constructor");
public void method_1()
LinkedList list = new LinkedList();
//List list = Arrays.asList(first);
//List<String> list = new ArrayList<String>();
System.out.println("Sort arrays");
for(int i = 0; i < first.length; i++)
System.out.println("Print all " +list);
System.out.println("Print First item " + list.getFirst());
System.out.println("Print Last item " + list.getLast());