Here you can find the source of createKeyboardScanner()
public static Scanner createKeyboardScanner()
//package com.java2s; /*==========================================================================*\ | $Id: IOHelper.java,v 1.3 2011/06/09 15:30:25 stedwar2 Exp $ |*-------------------------------------------------------------------------*| | Copyright (C) 2007-2010 Virginia Tech | | This file is part of the Student-Library. | | The Student-Library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public License as | published by the Free Software Foundation; either version 3 of the | License, or (at your option) any later version. | | The Student-Library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU Lesser General Public License for more details. | | You should have received a copy of the GNU Lesser General Public License | along with the Student-Library; if not, see <http://www.gnu.org/licenses/>. \*==========================================================================*/ import java.util.Scanner; public class Main { /**//w w w .ja va2 s.c o m * Creates and returns a {@link Scanner} that * can be used to read from the keyboard. This is just a convenience * method for uniformity, since the Scanner class provides a constructor * that can take {@link System#in} as a parameter. * To enter text, you usually have to switch to some console in your * IDE. Also, remember not to close the keyboard scanner. The {@link * Scanner#nextLine()} method blocks until the user hits enter. * * @return instance of {@link Scanner} for reading from keyboard */ public static Scanner createKeyboardScanner() { return new Scanner(System.in); } }