Javatpoint Logo

what will be output after running below main method ?

By: premje*** On: Tue Jun 20 00:56:48 IST 2017     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
public static void main(String args[]){
try{
HashSet hashSet = new HashSet();
String one = null;
hashSet.add(one);
hashSet.add("two");
hashSet.add("Three");
Iterator iterator = hashSet.iterator();
while(iterator.hasNest()) {
System.out.println(iterator.nest());
}}}


options :
a. null b. two c. compilation fail d. null pointer exception
two three
three
Up0Down
core java  x  328Tags