Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    5
    Views
    1,362

    Re: WHy is it going straight to my exception?

    Using Scanner class methods has a problem with the end line character staying in the buffer. Mixing calls to nextInt() with calls to nextLine() will mean nextLine() reads an empty line as it clears...
  2. Replies
    5
    Views
    1,362

    Re: WHy is it going straight to my exception?

    The call to parseInt() on line 35 is passing it an empty String: ""
    One way to prevent that is have the program test the contents of the String before using it in a call to parseInt()
  3. Replies
    5
    Views
    1,362

    Re: WHy is it going straight to my exception?

    Add a call to the printStackTrace() method in the catch block so the reason and location of the exception is printed.
Results 1 to 3 of 3