1.

Give the output of the following string functions: (i) “MISSISSIPPI”.indexOf(‘S’) + “MISSISSIPPF”.lastIndexOf(‘I’) (ii) “CABLE”.compareTo(“CADET”)

Answer»

(i) 2 + 10 = 12 

(ii) -3



Discussion

No Comment Found

Related InterviewSolutions