Which line will print the string "MUM"?
public class Main{ public static void main (String args []){ String s = "MINIMUM"; System.out.println (s.substring (4, 7)); //1 System.out.println (s.substring (5)); //2 System.out.println (s.substring (s.indexOf ('I', 3))); //3 System.out.println (s.substring (s.indexOf ('I', 4))); //4 } }
Select 1 option
Correct Option is : A
You should know how substring and indexOf methods of String class work.