Search:

Type: Posts; User: Noob_Programmer

Search: Search took 0.24 seconds.

  1. Replies
    6
    Views
    2,507

    Re: Scanner.useDelimiter("\n") Problem

    Yeah the \n changes it. I might just not use it, and use my other solution to the problem I was having. Appreciate your help anyway!
  2. Replies
    6
    Views
    2,507

    Re: Scanner.useDelimiter("\n") Problem

    Just the number 1.

    If I remove the s.useDelimiter("\n");

    There is no problems, but I was told to use this to solve another problem, which is using nextLine() before a nextInt().
  3. Replies
    6
    Views
    2,507

    Re: Scanner.useDelimiter("\n") Problem

    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Unknown Source)
    at java.util.Scanner.next(Unknown Source)
    at java.util.Scanner.nextInt(Unknown Source)...
  4. Replies
    6
    Views
    2,507

    Scanner.useDelimiter("\n") Problem

    Hey guys I am having some trouble when I use Scanner.UseDelimeter("\n") basically I have:


    Scanner s = new Scanner(System.in);
    s.useDelimiter("\n");

    int amount;

    ...
Results 1 to 4 of 4