Computer Applications
The indexOf() method returns the position of the …………… .
- first occurrence of the specified character
- last occurrence of the specified character
- null character
- '\n' character
Java String Handling
3 Likes
Answer
first occurrence of the specified character
Reason — The indexOf() method returns the index (position) of the first occurrence of the specified character in a string.
Answered By
1 Like
Related Questions
While using the toLowerCase() method on a string containing special characters, …………… .
- the special characters remain unaffected.
- the special characters are converted to spaces.
- the special characters are converted to null character.
- the special characters are removed from the string.
The index of a string …………… .
- ranges from 0 to the length -1 of the string
- ranges from 0 to the length of the string
- ranges from 1 to the length of the string
- ranges from 1 to the length -1 of the string
The return type of the equals() method is …………… .
- int
- char
- boolean
- void
Which one of the given statements is true for the following statement? string1.compareTo(string2)
- if string1 > string2 the result will be a negative integer i.e. < 0.
- if string1 > string2 the result will be a positive integer i.e. > 0.
- if string1 > string2 the result will be 0.
- None of the above