Search:

Type: Posts; User: copeg

Search: Search took 0.10 seconds.

  1. Thread: java-Exception

    by copeg
    Replies
    11
    Views
    2,107

    Re: java-Exception

    That is not an SSCCE. That being said, there are two calls to parseInt - one within your validation, one above. You should make use of printing out variable values (for debugging) and exception stack...
  2. Thread: java-Exception

    by copeg
    Replies
    11
    Views
    2,107

    Re: java-Exception

    In that short clip posted, no. But, in the code you posted in post 5, your variable is called 'StudentID', not 'sudentid'. Post an SSCCE and we can all be on the same page when referring to code.
  3. Thread: java-Exception

    by copeg
    Replies
    11
    Views
    2,107

    Re: java-Exception

    Please define, "it doesn't work" (to be blunt: that's about as much information to us as us saying to you "then fix it")
  4. Thread: java-Exception

    by copeg
    Replies
    11
    Views
    2,107

    Re: java-Exception

    Exactly. Is an empty string a parsable integer? No. Validate user input if you expect an integer, or catch the exception.

    And please, when posting code, wrap it in the code tags. The forum rules...
  5. Thread: java-Exception

    by copeg
    Replies
    11
    Views
    2,107

    Re: java-Exception

    Read the API for the methods you are using - it describes why an exception would be thrown.
    Integer (Java Platform SE 6)

    And for future reference, it help s to place context by posting an SSCCE
Results 1 to 5 of 5