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

Author Question: Suppose s1 and s2 are two strings. What is the result of the following code? s1.equals(s2) == s2.equals(s1) (Read 33 times)

jenna1

  • Hero Member
  • *****
  • Posts: 568

Question 1

Suppose s1 and s2 are two strings. Which of the following statements or expressions is incorrect?
◦ boolean b = s1.compareTo(s2);
◦ String s3 = s1 - s2;
◦ char c = s1[0];
◦ char c = s1.charAt(s1.length());

Question 2

Suppose s1 and s2 are two strings. What is the result of the following code?

 s1.equals(s2) == s2.equals(s1)

◦ true
◦ false


Related Topics

Need homework help now?

Ask unlimited questions for free

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

huda

  • Sr. Member
  • ****
  • Posts: 304
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 50% of students answer this correctly




jenna1

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


jordangronback

  • Member
  • Posts: 339
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

Blood in the urine can be a sign of a kidney stone, glomerulonephritis, or other kidney problems.

Did you know?

Adolescents often feel clumsy during puberty because during this time of development, their hands and feet grow faster than their arms and legs do. The body is therefore out of proportion. One out of five adolescents actually experiences growing pains during this period.

Did you know?

As the western states of America were settled, pioneers often had to drink rancid water from ponds and other sources. This often resulted in chronic diarrhea, causing many cases of dehydration and death that could have been avoided if clean water had been available.

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

Did you know?

Approximately 500,000 babies are born each year in the United States to teenage mothers.

For a complete list of videos, visit our video library