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

Coderanch | Pat Steele | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    A very basic code problem

    Coderanch | 2 years ago | Pat Steele
    java.lang.StringIndexOutOfBoundsException: String index out of range: 98098

    Root Cause Analysis

    1. java.lang.StringIndexOutOfBoundsException

      String index out of range: 98098

      at java.lang.String.substring()
    2. Java RT
      Scanner.nextInt
      1. java.lang.String.substring(String.java:1950)
      2. java.util.Scanner.buildIntegerPatternString(Scanner.java:423)
      3. java.util.Scanner.integerPattern(Scanner.java:443)
      4. java.util.Scanner.nextInt(Scanner.java:2117)
      4 frames
    3. Unknown
      easydoesit.main
      1. easydoesit.main(easydoesit.java:16)
      1 frame