Die Methode substring (int) löst StringIndexOutOfBoundsException [duplicate] auf magische Weise nicht aus

Diese Frage hat hier bereits eine Antwort:

Warum wird "out of range" nicht für "substring (startIndex, endIndex)" geworfen 6 Antworten

Warum tut"a".substring(1) nichtthrow StringIndexOutOfBoundsException, während es für den Index tut, der> = 2 ist? Das ist wirklich interessant.

Danke im Voraus!

Antworten auf die Frage(6)

Ihre Antwort auf die Frage