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.*;public class Test { public static void ... (Read 172 times)

Mimi

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

import java.util.*;

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

List list2 = new ArrayList<>();
list2.add("Atlanta");
list2.add("Macon");
list2.add("Savanna");

List list3 = new ArrayList<>();
list3.add("Macon");
list3.add("Savanna");
list3.add("Atlanta");

System.out.println(list1.equals(list2) + " " + list1.equals(list3));
}
}

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


Related Topics

Need homework help now?

Ask unlimited questions for free

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

kjohnson

  • Sr. Member
  • ****
  • Posts: 330
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




Mimi

  • Member
  • Posts: 542
Reply 2 on: May 6, 2020
Excellent


Dominic

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

 

Did you know?

In ancient Rome, many of the richer people in the population had lead-induced gout. The reason for this is unclear. Lead poisoning has also been linked to madness.

Did you know?

As many as 28% of hospitalized patients requiring mechanical ventilators to help them breathe (for more than 48 hours) will develop ventilator-associated pneumonia. Current therapy involves intravenous antibiotics, but new antibiotics that can be inhaled (and more directly treat the infection) are being developed.

Did you know?

HIV testing reach is still limited. An estimated 40% of people with HIV (more than 14 million) remain undiagnosed and do not know their infection status.

Did you know?

All adverse reactions are commonly charted in red ink in the patient's record and usually are noted on the front of the chart. Failure to follow correct documentation procedures may result in malpractice lawsuits.

Did you know?

Hippocrates noted that blood separates into four differently colored liquids when removed from the body and examined: a pure red liquid mixed with white liquid material with a yellow-colored froth at the top and a black substance that settles underneath; he named these the four humors (for blood, phlegm, yellow bile, and black bile).

For a complete list of videos, visit our video library