java.lang.StringIndexOutOfBoundsException: String index out of range: 6

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.

,
via oracle.com by Unknown author

Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.

Solutions on the web

via Coderanch by Carey Brown, 1 year ago
via Coderanch by micahel dunn, 1 year ago
via Stack Overflow by Mayukh Nair
, 2 years ago
String index out of range: 5
via Stack Overflow by tmgr
, 7 months ago
via Coderanch by Avi Sridhar, 1 year ago
String index out of range: 60
via Coderanch by kenny koh, 1 year ago
String index out of range: -2.
java.lang.StringIndexOutOfBoundsException: String index out of range: 6
at java.lang.String.charAt(String.java:658)
at javaapplication78.NewEncryptAndDecrypt.encrypt(JavaApplication78.java:70)
at javaapplication78.NewEncryptAndDecrypt.input(JavaApplication78.java:37)
at javaapplication78.JavaApplication78.main(JavaApplication78.java:17)

Users with the same issue

3 times, 1 month ago
2 times, 1 month ago
Once, 1 month ago
Once, 1 month ago
Once, 2 months ago
43 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.