hello,
I need to create a Scanner in my code, and I've googled it and it seems like I can open the Scanner utility just fine. But I found out later that you need to close the Scanner, and I can't seem to figure that out. I think the basic setup is --
import java.util.Scanner;
body of code
Scanner keyboard = new Scanner(System.in);
int productnumber = keyboard.nextInt();
then more code
scanner.close();
The thing is, scanner.close(); never works in Eclipse. It always complains with the error " scanner cannot be resolved" like it thinks scanner is a variable.
I think because I'm not closing the scanner the code doesn't run correctly.
Anybody have any ideas?