Java BufferedReader Read Line readLine()

Here you can find the source of readLine()

Description

read Line

License

Open Source License

Declaration

public static final String readLine() 

Method Source Code


//package com.java2s;
/*/* w  w  w .j ava 2  s  . com*/
 * This software is a city building and resource management strategy game.
 * Copyright (C) 2018 Javier Centeno Vega
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program 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 General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */

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

public class Main {
    private static final BufferedReader INPUT_READER = new BufferedReader(new InputStreamReader(System.in));

    public static final String readLine() {
        String result = "";
        try {
            result = INPUT_READER.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }

    public static final String readLine(String request) {
        System.out.println(request);
        return readLine();
    }
}

Related

  1. readLine()
  2. readLine()
  3. readLine()
  4. readLine()
  5. readLine()
  6. readLine()
  7. readLine(BufferedReader br)
  8. readLine(BufferedReader br, int maxlen)
  9. readLine(BufferedReader in)