Auto AdSense

Saturday, 22 November 2014

Java Program on DataInputStream

      public class Test
   {
     public static void main(String args[])throws IOException
     {
       DataInputStream d = new DataInputStream(new FileInputStream("test.txt"));
      
       DataOutputStream out = new DataOutputStream(new FileOutputStream("test1.txt"));
      
       String count;
       while((count = d.readLine()) != null)
       {
         String u = count.toUpperCase();
         System.out.println(u);
         out.writeBytes(u + " ,");
       }
       d.close();
       out.close();
      
     }
   }   

No comments:

Post a Comment