I'm making a small game for an assignment which involves the user entering numbers from standard input. We were told to do this using the Scanner class, so in my main method I have:
This compiles and works fine but I want to use this same Scanner object, referenced by scan, in a method contained in a different class called Contestant. So my method looks like this:
However, the javac compiler is giving me some error when I try and make this method. What am I doing wrong? How could I access the same scanner in my Contestant class as the one I have created
in the main() method? I hope I have been clear enough as to what I am trying to do! Any help is much appreciated.