.,'this is a simple java codes in w/c will enable to read a txt files.
alpe's program to read a txt file.
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);
}
}
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.