Summer Special Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 8w52ceb345

Mark works as a Programmer for InfoTech Inc.

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 = new 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?

A.

Wednesday Sunday Monday Friday

B.

An exception will be thrown at runtime.

C.

Friday Monday Sunday Wednesday

D.

Sunday Monday Wednesday Friday

GSSP-Java PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now GSSP-Java pdf
Get 60% Discount on All Products, Use Coupon: "8w52ceb345"