Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Example of ArrayDeque

import java.util.ArrayDeque;

class Main {
    public static void main(String[] args) {
        ArrayDeque<String> fruits= new ArrayDeque<>();

        // Using add()
        fruits.add("Apple");

        // Using addFirst()
        fruits.addFirst("Banana");

        // Using addLast()
        fruits.addLast("Mango");
        System.out.println("ArrayDeque: " + fruits);
    }
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Example #ArrayDeque
ADD COMMENT
Topic
Name
8+5 =