

Java.lang Class - Programming
Q1: What will be the output of the program?
String a = 'newspaper';
a = a.substring(5,7);
char b = a.charAt(1);
a = a + b;
System.out.println(a);
A apa
B app
C apea
D apep
ANS:A - apa Both substring() and charAt() methods are indexed with a zero-base, and substring() returns a String of length arg2 - arg1. |


For help Students Orientation
Mcqs Questions
One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.