R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method is used to compare strings in Java for equality?

  • (A) ==
  • (B) equals()
  • (C) compareTo()
  • (D) isEqual()
  • Correct Answer - Option(B)
  • Views: 12
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`equals()` compares the contents of strings for equality.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.