Monday, 17 November 2014

Java : Collection Framework : Deque (Size method)


Click here to watch in Youtube :
https://www.youtube.com/watch?v=h41jgoMwOPQ&list=UUhwKlOVR041tngjerWxVccw

DequeExample.java
import java.util.Deque;
import java.util.LinkedList;

/*
 *  Example of size() method.
 */
public class DequeExample
{

    public static void main(String[] args)
    {
        Deque<Integer> deque = new LinkedList<Integer>();
        deque.add(2000);
        deque.add(5000);
        deque.add(10000);

        System.out.println("deque : " + deque + "\n");

        /*
         * Returns the number of elements in this deque.
         */
        int size = deque.size();
        System.out.println("size : " + size);

    }

}



Output
deque : [2000, 5000, 10000]

size : 3

To Download DequeDemoSize Project Click the below link
https://sites.google.com/site/javaee4321/java-collections/DequeDemoSize.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