This topic contains a solution. Click here to go to the answer

Author Question: What is the output of the following code?import java.util.*;import java.util.*;public class Test { ... (Read 187 times)

sc00by25

  • Hero Member
  • *****
  • Posts: 596
What is the output of the following code?

import java.util.*;

import java.util.*;

public class Test {
public static void main(String[] args) {
Set set1 = new HashSet<>();
set1.add("Atlanta");
set1.add("Macon");
set1.add("Savanna");

Set set2 = new HashSet<>();
set2.add("Atlanta");
set2.add("Macon");
set2.add("Savanna");

Set set3 = new HashSet<>();
set3.add("Macon");
set3.add("Savanna");
set3.add("Atlanta");

System.out.println(set1.equals(set2) + " " + set1.equals(set3));
}
}

◦ true true
◦ false true
◦ true false
◦ false false


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by sc00by25 on May 6, 2020

nyrave

  • Sr. Member
  • ****
  • Posts: 344
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




sc00by25

  • Member
  • Posts: 596
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


blakcmamba

  • Member
  • Posts: 335
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

In most cases, kidneys can recover from almost complete loss of function, such as in acute kidney (renal) failure.

Did you know?

Astigmatism is the most common vision problem. It may accompany nearsightedness or farsightedness. It is usually caused by an irregularly shaped cornea, but sometimes it is the result of an irregularly shaped lens. Either type can be corrected by eyeglasses, contact lenses, or refractive surgery.

Did you know?

The calories found in one piece of cherry cheesecake could light a 60-watt light bulb for 1.5 hours.

Did you know?

When intravenous medications are involved in adverse drug events, their harmful effects may occur more rapidly, and be more severe than errors with oral medications. This is due to the direct administration into the bloodstream.

Did you know?

Lower drug doses for elderly patients should be used first, with titrations of the dose as tolerated to prevent unwanted drug-related pharmacodynamic effects.

For a complete list of videos, visit our video library