public class LinkedList{
private Link first;
public LinkedList(){
first = null;
}
public boolean isEmpty(){
return first==null;
}
public void insert(String s1, String s2, double d1){
Link linklist = new Link(s1, s2, d1 );
linklist.next=first;
first=linklist;
}
public Object delete(){
Link temp=first;
first=first.next;
return temp;
}
public void printList(){
Link current=first;
System.out.println("List Elements are ");
while (current !=null){
current.printListElements();
current=current.next;
}
}
public static void main (String args []){
LinkedList linkedList1=new LinkedList();
linkedList1.insert("Bob","Jim",3.0);
linkedList1.insert("Rick","Terry", 1500.00);
linkedList1.insert("James","Henry", 2000.00);
linkedList1.insert("Harold","Anthony", 3000.00);
linkedList1.printList();
linkedList1.delete();
linkedList1.printList();
}
}