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 39 times)

bobthebuilder

  • Hero Member
  • *****
  • Posts: 567
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 = new String("Welcome to Java!");
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 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 bobthebuilder on May 6, 2020

diana chang

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




bobthebuilder

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


Animal_Goddess

  • Member
  • Posts: 339
Reply 3 on: Yesterday
Excellent

 

Did you know?

Colchicine is a highly poisonous alkaloid originally extracted from a type of saffron plant that is used mainly to treat gout.

Did you know?

Opium has influenced much of the world's most popular literature. The following authors were all opium users, of varying degrees: Lewis Carroll, Charles, Dickens, Arthur Conan Doyle, and Oscar Wilde.

Did you know?

Less than one of every three adults with high LDL cholesterol has the condition under control. Only 48.1% with the condition are being treated for it.

Did you know?

As many as 20% of Americans have been infected by the fungus known as Histoplasmosis. While most people are asymptomatic or only have slight symptoms, infection can progress to a rapid and potentially fatal superinfection.

Did you know?

Today, nearly 8 out of 10 pregnant women living with HIV (about 1.1 million), receive antiretrovirals.

For a complete list of videos, visit our video library