Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class AEIOU {
    public static void main(String[] args) {
        ArrayDeque<Character> list = new ArrayDeque<Character>();
        list.add('A');
        list.add('E');
        list.add('I');
        list.add('O');
        list.add('U');
        System.out.println(list);
        list.remove();
        list.addFirst('5');
        list.addLast('2');
        System.out.println(list);
    }
}


[A, E, I, O, U]
[5, 2]
[A, E, I, O, U]
[5, E, I, O, 2]
[A, E, I, O, U]
[5, E, I, O, U, 2]
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