IO Management: BufferedReader Class

IO Management includes BufferedReader, InputStreamReader, FileInputStream, FileOutputStream, PrintWriter and many important classes.

In this blog, we will work on package, BufferedReader, InputStreamReader classes and readLine() method.

IO Management Example




                readLine() – method -> Return String value


class io1


                public static void main(String args[]) throws IOException


                                // Find the area of circle using readLine() method

                                double PI = 3.14;

                                int r;


                                double area;


                                InputStreamReader obj = new InputStreamReader(;

                                BufferedReader br = new BufferedReader(obj);

                                //BufferedReader br = new BufferedReader(new InputStreamReader(;


                                System.out.print(“Enter R : “);

                                r =  Integer.parseInt(br.readLine());

                                // r = int

                                // br.readLine() – wrapper class String

                                // String class to int data type


                                area = PI * r * r;

                                System.out.println(“Area of Circle = ” + area);   




Enter R : 10

Area of Circle = 314.0


Video available on YouTube.


If you have any query on blog example, you can directly comment us or subscribe our website


Earn Money Online

457total visits,1visits today


Hello, I am Maddy a Java blogger, trainer and developer

Related articles

Comments are closed.