[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

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() + " ");
}
}

ACompile error

BRuntime Exception

C7 9

DNone of the above

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!