Inserts the specified element at the front of this list.
Program
package com.candidjava;
import java.util.LinkedList;
/**
*
* @author : mohan
* @description :The java.util.LinkedList.offerFirst(E e) method inserts the
* specified element at the front of this list.
*/
public class LinkedListOfferFirst {
public static void main(String[] args) {
LinkedList list = new LinkedList();
list.add("anandh");
list.add("hari");
list.add("vinoth");
list.add("mohan");
list.add("kamal");
System.out.println("LinkedList:" + list);
list.offerFirst("SIVA");
System.out.println("LinkedList:" + list);
}
}