Q. What will be the output of given code
Code:
import java.util.HashSet;
import java.util.Set;
public class HashSetTest
{
public static void main (String args[])
{
Set hashSet = new HashSet();
hashSet.add(“1”);
hashSet.add(1);
hashSet.add(null);
hashSet.add(“null”);
System.out.println(hashSet);
}
}
β
Correct Answer: (C)
[null, 1, 1, null]