BufferedReader Class with readLine() method

In this blog, we will again work on BufferedReader class with readLine() method. But in this program will control our string in output. Like when we write “stop” word in output screen, program will automatically stop and display final result.


Let’s take example on BufferedReader Class

import java.io.*;

class io2


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


                                BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

                                String str = “”;


                                while((str = br.readLine()).compareTo(“Stop”) !=0)







Welcome in Portal IssSearch Stop

Welcome in Portal IssSearch


Video available on YouTube.


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

Earn Money Online

593total visits,2visits today


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

Related articles

Comments are closed.