Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class ArrayDequeDemo {
    public static void main(String[] args) {
        ArrayDeque<String> de = new ArrayDeque<String>();
        de.push("Apple");
        de.push("Banana");
        de.push("Orange");
        System.out.println("print the values:");
        for (Object element : de) {
            System.out.println(element);
        }
    }
}


print the values:
Orange
Banana
Apple
print the values:
Apple
Banana
Orange
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java ArrayDeque Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App