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.
public class bufferedreader
public static void main (String args)
String userName = null;
System.out.print("Enter your name: ");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
userName = bufferedReader.readLine();
System.out.println("Thanks for using this snippet " + userName);