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!
Type: Posts; User: Noob_Programmer
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!
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().
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)...
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;
...