Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Element {
    public static void main(String[] args) {
        ArrayDeque<Integer> e = new ArrayDeque<Integer>();
        e.add(20);
        e.add(30);
        e.add(40);
        int rv= e.element();
        System.out.println("Retrieved Element is = " + rv);
    }
}


Retrieved Element is = 40
Retrieved Element is = 30
Retrieved Element is = 20
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