Search:

Type: Posts; User: curmudgeon

Search: Search took 0.08 seconds.

  1. Replies
    3
    Views
    1,451

    [SOLVED] Re: Integer and if statement

    Myself, I'd prefer doing something like (in pseudocode):



    do
    prompt for an int
    if no int held by Scanner (! hasNextInt)
    done gets the Scanner's next line
    else
    list get's...
  2. Replies
    3
    Views
    1,451

    [SOLVED] Re: Integer and if statement

    You can't call a method on a primitive, and the compiler should be complaining to you about this. You would do your parsing in a try/catch block and catch for a NumberFormatException. Search on this...
Results 1 to 2 of 2