.,'this is a simple java codes in w/c will enable to read a txt files.

import java.io.*;
public class file
{
    public static void main (String []args) throws IOException
    {
    String out="";
          BufferedReader in = new BufferedReader(new FileReader("file.java"));
        String str;
        while ((str = in.readLine()) != null)
         {
            out+=str+"\n";
        }
        in.close();
        System.out.print(out);
    }
}