Computer Applications
The return type of the equals() method is …………… .
- int
- char
- boolean
- void
Java String Handling
3 Likes
Answer
boolean
Reason — The equals() method compares two strings to check whether they are equal or not. The result is a boolean value true
if they are equal, otherwise the result is false
.
Answered By
1 Like
Related Questions
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 indexOf() method returns the position of the …………… .
- first occurrence of the specified character
- last occurrence of the specified character
- null character
- '\n' character
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
Which one of the given statements is true for the following statement? string1.compareTo(string2)
- if string1 > string2 the result will be a positive integer i.e. > 0.
- if string1 < string2 the result will be a negative integer i.e. < 0.
- if string1 = string2 the result will be 0 i.e. = 0.
- all of these