Here you can find the source of getUserInput(String whatever)
Parameter | Description |
---|---|
whatever | a parameter |
public static String getUserInput(String whatever)
//package com.java2s; //License from project: Apache License import java.util.Scanner; public class Main { /**/*from w ww . j av a2s .c o m*/ * Obtain user input from command line * * @param whatever * @return the input from the command line */ public static String getUserInput(String whatever) { // prompt the user to enter whatever System.out.print("Enter " + whatever + " :"); @SuppressWarnings("resource") Scanner scanner = new Scanner(System.in); return scanner.nextLine(); } }