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 32 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
YES! Correct, THANKS for helping me on my review


isabelt_18

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

 

Did you know?

Side effects from substance abuse include nausea, dehydration, reduced productivitiy, and dependence. Though these effects usually worsen over time, the constant need for the substance often overcomes rational thinking.

Did you know?

The Centers for Disease Control and Prevention (CDC) was originally known as the Communicable Disease Center, which was formed to fight malaria. It was originally headquartered in Atlanta, Georgia, since the Southern states faced the worst threat from malaria.

Did you know?

In ancient Rome, many of the richer people in the population had lead-induced gout. The reason for this is unclear. Lead poisoning has also been linked to madness.

Did you know?

In 2010, opiate painkllers, such as morphine, OxyContin®, and Vicodin®, were tied to almost 60% of drug overdose deaths.

Did you know?

Stevens-Johnson syndrome and Toxic Epidermal Necrolysis syndrome are life-threatening reactions that can result in death. Complications include permanent blindness, dry-eye syndrome, lung damage, photophobia, asthma, chronic obstructive pulmonary disease, permanent loss of nail beds, scarring of mucous membranes, arthritis, and chronic fatigue syndrome. Many patients' pores scar shut, causing them to retain heat.

For a complete list of videos, visit our video library