Java IO Tutorial - Java BufferedReader(Reader in) Constructor








Syntax

BufferedReader(Reader in) constructor from BufferedReader has the following syntax.

public BufferedReader(Reader in)

Example

In the following code shows how to use BufferedReader.BufferedReader(Reader in) constructor.

/*from w w  w .ja va2s. c  om*/
import java.io.BufferedReader;
import java.io.StringReader;

public class Main {
  public static void main(String[] args) throws Exception {

    String s = "from java2s.com";

    StringReader sr = new StringReader(s);

    BufferedReader br = new BufferedReader(sr);



  }
}