Java BufferedReader Read Line readLineFromConsole()

Here you can find the source of readLineFromConsole()

Description

read Line From Console

License

Apache License

Declaration

public static String readLineFromConsole() 

Method Source Code


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

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static String readLineFromConsole() {
        try {//  w w w  . j  a v a 2 s . c o m
            BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
            String line = bufferRead.readLine();
            return line;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. readLine(String value, BufferedReader procout)
  2. readLineByLine(File file, char[][] terminators, boolean keepTerminators, Consumer readLineListener)
  3. readLineFile(File file)
  4. readLineFile(String filePath)
  5. readLineFromCommand(String command[])
  6. readLineHard(BufferedReader in)
  7. readLineList(String fileName)
  8. readLineToList(String pathName, String enCoding)