Mention the purpose and syntax of lastIndexOf() method.
Java String Handling
4 Likes
Answer
The lastIndexOf() method returns the index of the last occurrence of the specified character in a string. If the character does not occur in the string, it returns -1. Syntax: stringObject.lastIndexOf(char)