Search:

Type: Posts; User: helloworld922

Search: Search took 0.12 seconds.

  1. Replies
    10
    Views
    2,640

    Re: Values of Input

    Someone decided that's what it should return if the user doesn't OK the output :P

    That's the only value that's available since technically an empty string "" is an allowed OK return value.
  2. Replies
    10
    Views
    2,640

    Re: Values of Input

    Regardless of how he gets the input, he will still have to parse it.

    JOptionPane will return a string just as Scanner will return a String. The only difference is that JOptionPane will return null...
  3. Replies
    10
    Views
    2,640

    Re: Values of Input

    The reason you can't parse right away is because you don't know if the user typed in Quit/Exit. It takes a few steps to parse whatever the user typed, so it's better to do the number parsing later.
  4. Replies
    10
    Views
    2,640

    Re: Values of Input

    Two ways: one is to input a string, then wait for the user to type something like quit, and another way is just tell the user to type quit, and catch the exception thrown (or not).


    Scanner input...
Results 1 to 4 of 4