Here you can find the source of queryStr(Scanner in, String msg)
public static String queryStr(Scanner in, String msg)
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { public static String queryStr(Scanner in, String msg) { System.out.printf("%s", msg); String response = in.nextLine(); if (response.length() == 0) { System.out.printf("Please enter a valid string!\n"); }// w w w .j av a 2s . c o m return response; } }