JAVA Program to Print File Content in Uppercase

JAVA Program to Print File Content in Uppercase:

/* CONVERT FILE CONTENT IN UPPERCASE */
import java.io.*;
import java.lang.*;
class file5
{
 public static void main(String args[])
 {
  BufferedReader br=null;
  File f1=new File(args[0]);
  try
  {
   br= new BufferedReader(new FileReader(f1));

   String line="";
   while((line=br.readLine())!=null)
   {
     System.out.println(line.toUpperCase());
   }
  }
  catch(Exception e){}

  finally
  {
      try
      {
   br.close();
}
catch(Exception e){}
  }
 }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.