Develop a Java program to echo every line entered by the user. Terminate the program when the line is empty

import java.io.*;

class Exp11_3
{
 public static void main(String[] args) throws IOException
 {
  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  String str=br.readLine();
  while(!str.isEmpty())
  {
   System.out.println(str);
   str = br.readLine();
  }
 }
}
/*  OUTPUT!!!
Welcome to
Welcome to
Java
Java
*/

Copyright © LetML. Blogger Templates Designed by OddThemes