Search:

Type: Posts; User: andreas90

Search: Search took 0.07 seconds.

  1. Replies
    9
    Views
    1,479

    [SOLVED] Re: User selection problem

    Glad you got it work.
    Just for the record, you can take the input evaluation (if...else block) outside the try...catch block since in the latter you are just checking for the exception.
  2. Replies
    9
    Views
    1,479

    [SOLVED] Re: User selection problem

    It "complains" becaused you took away the else block and therefore there is case that the method will not return anything. For example if the selection is out of the entered bounds.
  3. Replies
    9
    Views
    1,479

    [SOLVED] Re: User selection problem

    "exceptionthatmaybethrown" was just fordemonstration. You should catch the exception that actually may be thrown which in your case is the NumberFormatException.


    The try block should contain the...
  4. Replies
    9
    Views
    1,479

    [SOLVED] Re: User selection problem

    try {
    //code that may throw the exception, the parsing method
    } catch (ExceptionThatMayBeThrown e) {
    e.getStackTrace();
    return INVALID;...
  5. Replies
    9
    Views
    1,479

    [SOLVED] Re: User selection problem

    Hello Max!
    If I'm getting it right you want the method to return INVALID when it throws an exception. I think you can do that by surrounding the part of code that may through the exception (in your...
Results 1 to 5 of 5