Specify path and file for creating a file in Java
Description
The following code shows how to specify path and file for creating a file.
Example
//www .j a v a 2s . c om
import java.io.File;
public class Main {
public static void main(String[] a) {
File myFile = new File("C:/jdk1.5.0/src/java/io", "File.java");
System.out.println(myFile);
}
}
The code above generates the following result.