πŸ“Š JAVA
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]
πŸ’¬ Discuss
βœ… Correct Answer: (C) [1, 1, 3, 2]

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
203
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Pradeep Sikarwar
Publisher
πŸ“ˆ
86%
Success Rate