e.g)
public void a(){
Scanner input = new Scanner(System.in);
String a = input.nextLine();
....
input.close();
}
public void b(){
Scanner scan = new Scanner(System.in);
int b = scan.nextInt();
....
scan.close();
}
This Scanner does not operate correctly. But after remove close(), it works correctly.
I guess the reason is the 'System.in' have a problem.
Please give me answer.
Thank you
+) First call input.nextLine() in a(), and then call scan.nextInt() in b(). I have the error such as NoSuchElementException.