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


EAN94

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

 

Did you know?

Signs of depression include feeling sad most of the time for 2 weeks or longer; loss of interest in things normally enjoyed; lack of energy; sleep and appetite disturbances; weight changes; feelings of hopelessness, helplessness, or worthlessness; an inability to make decisions; and thoughts of death and suicide.

Did you know?

Tobacco depletes the body of vitamins A, C, and E, which can result in any of the following: dry hair, dry skin, dry eyes, poor growth, night blindness, abscesses, insomnia, fatigue, reproductive system problems, sinusitis, pneumonia, frequent respiratory problems, skin disorders, weight loss, rickets, osteomalacia, nervousness, muscle spasms, leg cramps, extremity numbness, bone malformations, decayed teeth, difficulty in walking, irritability, restlessness, profuse sweating, increased uric acid (gout), joint damage, damaged red blood cells, destruction of nerves, infertility, miscarriage, and many types of cancer.

Did you know?

Famous people who died from poisoning or drug overdose include, Adolf Hitler, Socrates, Juan Ponce de Leon, Marilyn Monroe, Judy Garland, and John Belushi.

Did you know?

Hippocrates noted that blood separates into four differently colored liquids when removed from the body and examined: a pure red liquid mixed with white liquid material with a yellow-colored froth at the top and a black substance that settles underneath; he named these the four humors (for blood, phlegm, yellow bile, and black bile).

Did you know?

Eating food that has been cooked with poppy seeds may cause you to fail a drug screening test, because the seeds contain enough opiate alkaloids to register as a positive.

For a complete list of videos, visit our video library