Java Bufferedreader Example - Java

How to use java bufferedreader?

Snippet Code

Rate this page :
  [ 0 votes]

Bufferreader class in java is used to provide a most efficient reading mechanism of an data from underlying reader into bufferedclass. The sample code for buffered class using java is given below.

import*; public class bufferedreader { public static void main (String[] args) throws Exception { String userName = null; System.out.print("Enter your name: "); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(; userName = bufferedReader.readLine(); System.out.println("Thanks for using this snippet " + userName); } }


Ask Questions

Ask Question