Line 1, runtime error IndexOutOfBoundsException
Line 2, Compile error, Expecting
String got anything
Line 3, Compile time error, something with the char literal being empty
Line 4, Compile error, Expecting char, char got char, anything
Line 5, prints out "sahil", the substring method can take length argument, it just returns same string
Line 6, I'm gonna go with IndexOutOfBoundsException
Line 7, false
Sahil, thanks for the effort you put in these questions
Regards,
Martin