import java.io.*;
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();
p1.method_1();
}
}
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>();
//HashSet list = new HashSet();
System.out.println("Sort arrays ");
Arrays.sort(first);
for(int i = 0; i < first.length; i++)
{list.add(first[i]);}
System.out.println("Print first " +list);
list.push("zeta");
System.out.println("pushed an item at the begning " +list);
list.pop();
System.out.println("remove the added item with pop " +list);
}
}

List is LIFO : Last In First OUT (just like a bucket of water, we scoop from the top), where as Stack is First in First Out just like people are waiting in a line, you serve the first person who entered earlier than others.