Here you can find the source of readLine()
public static String readLine()
//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 readLine() { try {/*from w w w. j av a 2 s .c om*/ return new BufferedReader(new InputStreamReader(System.in)).readLine(); } catch (IOException e) { throw new RuntimeException(e); } } }