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

Author Question: What is the output of the following code?public class Test { public static void main(String[] args) ... (Read 22 times)

londonang

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

public class Test {
public static void main(String[] args) {
String s1 = new String("Welcome to Java!");
String s2 = s1.toUpperCase();
if (s1 == s2)
System.out.println("s1 and s2 reference to the same String object");
else if (s1.equals(s2))
System.out.println("s1 and s2 have the same contents");
else
System.out.println("s1 and s2 have different contents");
}
}

◦ s1 and s2 reference to the same String object
◦ s1 and s2 have different contents
◦ s1 and s2 have the same contents


Related Topics

Need homework help now?

Ask unlimited questions for free

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

pangili4

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




londonang

  • Member
  • Posts: 540
Reply 2 on: May 6, 2020
:D TYSM


JCABRERA33

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

 

Did you know?

Disorders that may affect pharmacodynamics include genetic mutations, malnutrition, thyrotoxicosis, myasthenia gravis, Parkinson's disease, and certain forms of insulin-resistant diabetes mellitus.

Did you know?

According to the CDC, approximately 31.7% of the U.S. population has high low-density lipoprotein (LDL) or "bad cholesterol" levels.

Did you know?

Egg cells are about the size of a grain of sand. They are formed inside of a female's ovaries before she is even born.

Did you know?

Children of people with alcoholism are more inclined to drink alcohol or use hard drugs. In fact, they are 400 times more likely to use hard drugs than those who do not have a family history of alcohol addiction.

Did you know?

Vital signs (blood pressure, temperature, pulse rate, respiration rate) should be taken before any drug administration. Patients should be informed not to use tobacco or caffeine at least 30 minutes before their appointment.

For a complete list of videos, visit our video library