[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 :: Inheritance - Discussion

Home > JAVA Programming > Inheritance > MCQs Questions Discussion

4 / 9

What is the output for the below code?

import javutil.Iterator;
import javutil.TreeSet;
public class Test {
public static void main(String... args) {
TreeSet s1 = new TreeSet();
s1.add("one");
s1.add("two");
s1.add("three");
s1.add("one");
Iterator it = s1.iterator();
while (it.hasNext() ) {
System.out.print( it.next() + " " );
}
}
}

Aone three two

BRuntime Exception

Cone three two one

Done two three

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!