Why have you got all those members
static? It is a good idea to have the Scanner object
static, But having a
static games() method looks suspicious to me. Also you would do better to get the details from the Scanner, store them as some sort of variable, and pass that variable to the method. Rather than
try
... or something similar.
An alternative approach: Set up a utility class, like
this, with a
static Scanner field, like what Harsha Smith showed earlier. Rather than the multiplying method I showed, create methods like
public static int nextIntFromKeyboard(...); you can see what such a method contains
here. Remember that is not a complete method. If you ever use System.in or similar as a parameter to a Scanner or similar, don’t simply close the Scanner. Otherwise you close System.in and can’t reopen it