-
What is the output of this program?
public class Result
{
public static void main(String args[])
{
String str1 = "Interview Mania";
String str2 = str1.substring(0 , 9);
System.out.println(str2);
}
}
-
- Interview
- Mania
- Interview Mania
- Inter
- None of these
Correct Option: A
substring(0,9) returns the character from 0 th position to 8th position.