Code example for Scanner

Methods: closenextLine

0
	} 
 
	public static void main(String[] args) {
		Game game = loadDatabase();
		String userResponse = new String();
		Scanner in = new Scanner(System.in);
		game.runGameInstruction();
		 
		System.out.println("Do you want to start the game now? ( Y / N )");
		System.out.println(", or you can run SSH Secure Shell to see the database before running the game.");
		System.out.print(" -> ");
		 
		userResponse = in.nextLine();
		if (userResponse.charAt(0) == 'y' || userResponse.charAt(0) == 'Y') {
			game.run();
			game.showWinner();
		} 
 
		in.close();
	} 
}