Java Console Prompt prompt(String output)

Here you can find the source of prompt(String output)

Description

prompt

License

LGPL

Declaration

private static String prompt(String output) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Scanner;

public class Main {
    private static String prompt(String output) {
        System.out.print(output);
        Scanner input = new Scanner(System.in, "utf-8");
        String line = input.nextLine();
        input.close();/*from w ww  .ja va2 s  . c o  m*/
        return line;
    }
}

Related

  1. prompt(String message)
  2. prompt(String message, String defaults)
  3. prompt(String prompt)
  4. promptEnterKey()
  5. promptHidden(String message)
  6. promptPressEnterToExit()