aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Collections and Strings
  • Which of the following methods is/are defined in String c...
Multiple choice

Which of the following methods is/are defined in String class for comparing 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 all of the functions are defined in the String class, so this is the correct answer.

Keep practicing — related questions

  • Which of the following methods of a String class is used to compare the given string “str1” to another stri...
  • Which of the following methods of String class searches for the first occurrence of a character or substring?
  • To compare two strings for equality _____________ method is used.
  • Which of the following methods in string class of java searches for the last occurrence of a character or s...
  • Which of the following values in compareTo() method of String class is used to state that the invoking stri...
  • Which of the following methods cannot be used with the object of String class?
  • Which of the following methods cannot be used with the object of String class?
  • Which of the following methods cannot be used with the object of String class?
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Java Core Classes and Threads (1473 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy