T
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);
}
}
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 - Option(C)
- Views: 180
- Filed under category JAVA
Discusssion
Login to discuss.