Evening all. I am a complete beginner to programming with Java, and I am learning about \"Scanner\", but when I type this basic code into Eclipse, I get a message saying \"R
Because you are nowhere closing your Scanner. This is problem (classes that deal with I/O should be closed after you're done). You need to close it:
scanner.close();
So a whole code can looks like:
Scanner scanner = new Scanner(System.in);
try {
// work
}
finally {
if (scanner != null) {
scanner.close();
}
}