1(xvi)
The method compareTo() returns ............... when two strings are equal and in lowercase :
- (a)true
- (b)0
- (c)1
- (d)false
Show SolutionHide Solution↓
0
Reason — compareTo() method compares two strings lexicographically and returns the difference between the ASCII values of the first differing characters in the strings. Here, the strings are equal so the difference is 0.