This probably has a very obvious answer, but I just started learning Java and discovered this.
Say we have
String x = "apple";
Why is it that x.substring(5) returns "", an empty string while x.substring(6) throws an IndexOutOfBounds exception? Is there some kind of empty string that can be referenced appended to every string? Just not sure how it works.
Thanks!