Are upper bounds of indexed ranges always assumed to be exclusive?
问题 So in Java, whenever an indexed range is given, the upper bound is almost always exclusive. From java.lang.String : substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1 From java.util.Arrays : copyOfRange(T[] original, int from, int to) from - the initial index of the range to be copied, inclusive to - the final index of the range to be copied,