You can use the java IO API. In particular java.io.File , java.io.BufferedReader , java.io.BufferedWriter , etc.
Assuming that you are opening, you mean the opening file for reading. Also, for a good understanding of Java I / O functionality, check out this link: http://download.oracle.com/javase/tutorial/essential/io/
Check out the code below.
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class FileIO { public static void main(String[] args) { File file = new File("c:/temp/");
source share