Q. In Java, what is the purpose of the endsWith() method of a String object?

  • (A) To check if the string ends with a specified substring
  • (B) To add a suffix to the string
  • (C) To remove trailing whitespace
  • (D) To check if the string contains a specified character
πŸ’¬ Discuss
βœ… Correct Answer: (A) To check if the string ends with a specified substring

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
103
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
89%
Success Rate