Answer:
art applecart
Tricky Rules
The method
public String substring(int beginIndex )
creates a new string. The original string is not changed. There are two tricky rules:
- If
beginIndexis exactly equal to the length of the original string, a substring is created, but it contains no characters (it is an empty string) - If
beginIndexis greather than the length of the original string, or a negative value, aIndexOutOfBoundsExceptionis thrown (and for now, your program crashes).
QUESTION 19:
Decide on what string is formed by the following expressions: