JAVA Programming :: Threads - Discussion
Home > JAVA Programming > Threads > MCQs Questions Discussion
3 / 6
What is the output for the bellow code?
import javutil.Iterator;
import javutil.Set;
import javutil.TreeSet;
public class Test {
public static void main(String... args) {
Set s = new TreeSet();
s.add("7");
s.add(9);
Iterator itr = s.iterator();
while (itr.hasNext())
System.out.print(itr.next() + " ");
}
}
import javutil.Iterator;
import javutil.Set;
import javutil.TreeSet;
public class Test {
public static void main(String... args) {
Set s = new TreeSet();
s.add("7");
s.add(9);
Iterator itr = s.iterator();
while (itr.hasNext())
System.out.print(itr.next() + " ");
}
}
ACompile error
BRuntime Exception
C7 9
DNone of the above
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!