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

Author Question: What is the output of the following code? ArrayList list = new ArrayList(); String s1 = new ... (Read 41 times)

karen

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

ArrayList list = new ArrayList();
String s1 = new String("Java");
String s2 = new String("Java");
list.add(s1);
list.add(s2);
System.out.println((list.get(0) == list.get(1)) + " " + (list.get(0)).equals(list.get(1)));

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


Related Topics

Need homework help now?

Ask unlimited questions for free

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

hramirez205

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




karen

  • Member
  • Posts: 537
Reply 2 on: May 6, 2020
Great answer, keep it coming :)


scikid

  • Member
  • Posts: 300
Reply 3 on: Yesterday
Gracias!

 

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?

The Babylonians wrote numbers in a system that used 60 as the base value rather than the number 10. They did not have a symbol for "zero."

Did you know?

The average adult has about 21 square feet of skin.

Did you know?

Alcohol acts as a diuretic. Eight ounces of water is needed to metabolize just 1 ounce of alcohol.

Did you know?

About 3.2 billion people, nearly half the world population, are at risk for malaria. In 2015, there are about 214 million malaria cases and an estimated 438,000 malaria deaths.

For a complete list of videos, visit our video library