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 39 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
:D TYSM


Kedrick2014

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

 

Did you know?

The most common childhood diseases include croup, chickenpox, ear infections, flu, pneumonia, ringworm, respiratory syncytial virus, scabies, head lice, and asthma.

Did you know?

The Romans did not use numerals to indicate fractions but instead used words to indicate parts of a whole.

Did you know?

Only one in 10 cancer deaths is caused by the primary tumor. The vast majority of cancer mortality is caused by cells breaking away from the main tumor and metastasizing to other parts of the body, such as the brain, bones, or liver.

Did you know?

When Gabriel Fahrenheit invented the first mercury thermometer, he called "zero degrees" the lowest temperature he was able to attain with a mixture of ice and salt. For the upper point of his scale, he used 96°, which he measured as normal human body temperature (we know it to be 98.6° today because of more accurate thermometers).

Did you know?

In 1835 it was discovered that a disease of silkworms known as muscardine could be transferred from one silkworm to another, and was caused by a fungus.

For a complete list of videos, visit our video library