A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Write program using LinkedList in java

import java.util.LinkedList;
/**
 *
 * @author heerababu
 */
public class LL_Ex {
    public static void main(String args[])
    {
        LinkedList<String> ll=new LinkedList<String>();
        ll.addFirst("HEERA");
        ll.add("Navneet");
        ll.addLast("pawan");
        ll.add(3, "babu");
       
        System.out.println(ll);
        System.out.println(ll.clone());
       
        System.out.println(ll.get(1));
        System.out.println(ll.getFirst());
        System.out.println(ll.getLast());
    }
   
}


OUTPUT:



LEARN TUTORIALS

.

.