Create File Input Streams from file name in Java
Description
The following code shows how to create File Input Streams from file name.
Example
/* w w w . j a v a 2 s . c om*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class Main {
public static void main(String[] a) {
FileInputStream inputFile = null;
try {
inputFile = new FileInputStream("C:/myFile.txt");
} catch (FileNotFoundException e) {
e.printStackTrace(System.err);
}
}
}