String s = "EDUCATION IS LIFE";
Give output of the following
i. System.out.println(s.indexOf("LIFE"));
ii. System.out.println(s.substring(3,8));
Answers
Answered by
2
Given,
String s = "EDUCATION IS LIFE";
I. System.out.println(s.indexOf("LIFE"));
=> 13
II. System.out.println(s.substring(3, 8));
=> CATIO
Answered by
0
here is the answer:
indexOf method gives us the position of any element
i-13-16
substring method gives us the elements present at given position
ii-CATION
Similar questions