Friday 17 October 2014

Java : Collection Framework : LinkedList (Add Object)



Click here to watch in Youtube : https://www.youtube.com/watch?v=FuZbqUn9-Vs

LinkedListExample.java
import java.util.LinkedList;
/*
 * Example of add(E e) method.
 */
public class LinkedListExample
{

    public static void main( String[] args )
    {
        LinkedList<Integer> linkedList = new LinkedList<Integer>();

        /*
         * Appends the specified element to the end of this list.
         */
        linkedList.add(100);
        linkedList.add(200);
        linkedList.add(300);
        linkedList.add(400);

        System.out.println("linkedList : "+linkedList);
    }

}

Output
linkedList : [100, 200, 300, 400]

To Download LinkedListDemoAdd Project Click the below link

https://sites.google.com/site/javaee4321/java-collections/LinkedListDemoAdd.zip?attredirects=0&d=1

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • No comments:

    Post a Comment