How To Read A Text File in Java
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class fileinput {
public static void main(String[] args) throws IOException {
BufferedReader br = null;
String sCurrentLine;
br = new BufferedReader(new FileReader("C:\\Users\\home\\Documents\\Db.txt"));
while ((sCurrentLine = br.readLine()) != null) {
System.out.println(sCurrentLine);
}
}
}
No comments:
Post a Comment