Multiple choice

Which of the following methods are defined in the String class for comparing the Strings?

  1. equals(String s)

  2. compareToIgnoreCase(String s1)

  3. compareTo(String s3)

  4. Both 2 and 3

  5. All of the above

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

As I explained the reason, all of the functions are defined in the String class. So, this is the correct answer.