-
What is the output of this program?
public class Result
{
public static void main(String args[])
{
String ch = "Hello i love Interview mania";
int start = 13;
int end = 28;
char str[]=new char[end-start];
ch.getChars(start,end,str,0);
System.out.println(str);
}
}
-
- Hello i
- love Interview
- love Interview mania
- Hello i love Interview mania
- i love Interview mania
Correct Option: E
getChars(start,end,str,0) returns an array from the string c, starting index of array is pointed by start and ending index is pointed by end. s is the target character array where the new string of letters is going to be stored and the new string will be stored from 0th position in str.