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 164 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


aliotak

  • Member
  • Posts: 326
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

There can actually be a 25-hour time difference between certain locations in the world. The International Date Line passes between the islands of Samoa and American Samoa. It is not a straight line, but "zig-zags" around various island chains. Therefore, Samoa and nearby islands have one date, while American Samoa and nearby islands are one day behind. Daylight saving time is used in some islands, but not in others—further shifting the hours out of sync with natural time.

Did you know?

There are major differences in the metabolism of morphine and the illegal drug heroin. Morphine mostly produces its CNS effects through m-receptors, and at k- and d-receptors. Heroin has a slight affinity for opiate receptors. Most of its actions are due to metabolism to active metabolites (6-acetylmorphine, morphine, and morphine-6-glucuronide).

Did you know?

Acute bronchitis is an inflammation of the breathing tubes (bronchi), which causes increased mucus production and other changes. It is usually caused by bacteria or viruses, can be serious in people who have pulmonary or cardiac diseases, and can lead to pneumonia.

Did you know?

Patients who have undergone chemotherapy for the treatment of cancer often complain of a lack of mental focus; memory loss; and a general diminution in abilities such as multitasking, attention span, and general mental agility.

Did you know?

Essential fatty acids have been shown to be effective against ulcers, asthma, dental cavities, and skin disorders such as acne.

For a complete list of videos, visit our video library