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 176 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
Thanks for the timely response, appreciate it


fatboyy09

  • Member
  • Posts: 358
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

Interferon was scarce and expensive until 1980, when the interferon gene was inserted into bacteria using recombinant DNA technology, allowing for mass cultivation and purification from bacterial cultures.

Did you know?

Aspirin is the most widely used drug in the world. It has even been recognized as such by the Guinness Book of World Records.

Did you know?

The heart is located in the center of the chest, with part of it tipped slightly so that it taps against the left side of the chest.

Did you know?

Malaria mortality rates are falling. Increased malaria prevention and control measures have greatly improved these rates. Since 2000, malaria mortality rates have fallen globally by 60% among all age groups, and by 65% among children under age 5.

Did you know?

About one in five American adults and teenagers have had a genital herpes infection—and most of them don't know it. People with genital herpes have at least twice the risk of becoming infected with HIV if exposed to it than those people who do not have genital herpes.

For a complete list of videos, visit our video library