“REDUCE” .compareTo(“REVOLT”) + “ANTARTICA” lastIndexOf(‘A’)
Solution
Here compareTo() function returns the difference in two strings if they are not equal,if they are equal then returns zero
So, “REDUCE” .compareTo(“REVOLT”) results to 68-86
and, “ANTARTICA”.lastIndexOf(‘A’) results to 8
On adding these two (68-86)+8
=>-18+8
=>-10,this is the result