2(vii)
Give the output of the following String class methods:
(a) "COMMENCEMENT".lastIndexOf('M')
(b) "devote".compareTo("DEVOTE")
Show SolutionHide Solution↓
(a) "COMMENCEMENT".lastIndexOf('M')
8
ICSE Class 10 Computer Applications PYQ · 2023 Paper · Section A
Give the output of the following String class methods:
(a) "COMMENCEMENT".lastIndexOf('M')
(b) "devote".compareTo("DEVOTE")
(a) "COMMENCEMENT".lastIndexOf('M')
8