Here you can find the source of readLine()
private static String readLine() throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static String readLine() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader( System.in));/*from ww w. j a va 2 s . c om*/ String code = br.readLine(); br.close(); return code != null ? code.trim() : ""; } }