The ________ method of the String class returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
- indexOf(char ch)
- indexOf(char ch, int fromIndex)
- lastIndexOf(char ch)
- lastIndexOf(char ch, int fromIndex)
The lastIndexOf(char ch, int fromIndex) method of the String class is used to find the index of the last occurrence of the specified character within the string, starting the search from the given index fromIndex. The other options are related to the indexOf method but don't perform the same task.
Loading...
Related Quiz
- A thread that goes into the ________ state will not be brought back to the running state when its sleep time has elapsed or its operation is complete.
- The class ________ allows an application to write primitive Java data types to an output stream in a portable way.
- If a and b are boolean expressions, then a & b is true only if ______.
- To access or modify the private fields in a class, you should use ________ methods.
- What is the impact of using a SocketChannel in non-blocking mode over traditional blocking I/O socket communication?