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


daiying98

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

 

Did you know?

One way to reduce acid reflux is to lose two or three pounds. Most people lose weight in the belly area first when they increase exercise, meaning that heartburn can be reduced quickly by this method.

Did you know?

Drug-induced pharmacodynamic effects manifested in older adults include drug-induced renal toxicity, which can be a major factor when these adults are experiencing other kidney problems.

Did you know?

Anesthesia awareness is a potentially disturbing adverse effect wherein patients who have been paralyzed with muscle relaxants may awaken. They may be aware of their surroundings but unable to communicate or move. Neurologic monitoring equipment that helps to more closely check the patient's anesthesia stages is now available to avoid the occurrence of anesthesia awareness.

Did you know?

Approximately 70% of expectant mothers report experiencing some symptoms of morning sickness during the first trimester of pregnancy.

Did you know?

Amphetamine poisoning can cause intravascular coagulation, circulatory collapse, rhabdomyolysis, ischemic colitis, acute psychosis, hyperthermia, respiratory distress syndrome, and pericarditis.

For a complete list of videos, visit our video library