title: Using a scanner across multiple classes in Java?
body: <p>I have a program in Java that needs to get user input from the console at multiple points across multiple classes. I tried using a scanner in each class but when I close one scanner it closes system.in so I want to use the same scanner across the whole program. I open the scanner in the main class but how do I use the same scanner in other classes?</p>