GIAC GSSP-Java Question Answer
Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.
import java.util.*;
public class DemoSet{
public static void main(String[] args){
TreeSet
ts.add("Sunday");
ts.add("Friday");
ts.add("Wednesday");
ts.add("Sunday");
ts.add("Monday");
Iterator it = ts.iterator();
while(it.hasNext()){
System.out.print(it.next() + " ");
}
}
}
What will be the output when he tries to execute the given code snippet?