Vidyalelo
Java Programming · Q145

Java Collections Framework

Programming · Java Programming · question 145

Q145

What will be the output of the following Java program? import java.util.*; class Linkedlist public static void main(String args[]) LinkedList obj = new LinkedList(); obj.add("A"); obj.add("B"); obj.add("C"); obj.removeFirst(); System.out.println(obj);

A.
[A, B]
B.
[B, C]
Answer
C.
[A, B, C, D]
D.
[A, B, C]

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board