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
Math,
2 months ago
Political Science,
2 months ago
English,
2 months ago
India Languages,
5 months ago
Physics,
5 months ago
Science,
11 months ago
Physics,
11 months ago
Math,
11 months ago