Home » JAVA Programming » Strings » Question
  1. Which of these methods of class String is used to check whether a given object starts with a particular string literal?
    1. ends()
    2. startsWith()
    3. endsWith()
    4. Starts()
    5. None of these
Correct Option: B

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().



Your comments will be displayed only after manual approval.