P

Pradeep Sikarwar • 9.01K Points
Tutor III

Q. What will be the output of the following code

Code:
import java.util.LinkedHashSet;
import java.util.Set;
public class LinkedHashSetTest {
public static void main (String args[])
{
Set s=new LinkedHashSet();
s.add(“1”);
s.add(1);
s.add(3);
s.add(2);
System.out.println(s);
}
}
  • (A) [1, 1, 2, 3]
  • (B) [1, 2, 2 3[
  • (C) [1, 1, 3, 2]
  • (D) [1, 2, 3]
  • Correct Answer - Option(C)
  • Views: 149
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics