Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Relation {
    public static void main(String[] args) {
        ArrayDeque<String> s = new ArrayDeque<String>();
        s.add("Uncle");
        s.add("Aunt");
        s.add("Sister");
        s.addFirst("Mom");
        s.addLast("Dad");
        System.out.print(s);
    }
}


[Mom, Aunt, Dad]
[Mom, Uncle, Aunt, Sister, Dad]
[Mom, Uncle, Aunt, Dad]
[Uncle, Aunt, Sister]
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