Which of these methods of class String is used to check whether a given object starts with a particular string literal?

a) startsWith()
b) endsWith()
c) Starts()
d) ends()

1 thought on “Which of these methods of class String is used to check whether a given object starts with a particular string literal?”

  1. a
    Explanation: Method startsWith() of string class is used to check whether the String in question starts with a specified string. It is a specialized form of method regionMatches().

Leave a Comment