Search:

Type: Posts; User: John Joe

Search: Search took 0.13 seconds.

  1. Replies
    9
    Views
    866

    [SOLVED] Re: Unable to use Same scanner twice

    The problem is with the TAKER.nextInt(); method as it only reads the int value. So when compiler continue reading with TAKER.next(),the java.util.Scanner.next() method will finds and returns the...
  2. Replies
    9
    Views
    866

    [SOLVED] Re: Unable to use Same scanner twice

    Add TAKER.next(); after System.out.println("enter 1 for addition, 2 - subtracton, 3 - multiplication, 4 - division.");
  3. Replies
    9
    Views
    866

    [SOLVED] Re: Unable to use Same scanner twice

    But I tested your code, it crashed once you enter String, no?

    Output
    run:
    enter the numbers followed with a String to end the cycle
    123
    123w
    ok cool lets proceed
    enter 1 for addition, 2 -...
  4. Replies
    9
    Views
    866

    [SOLVED] Re: Unable to use Same scanner twice

    You can't input String. You are only allowed to input value with datatype int or double.
Results 1 to 4 of 4