构造文件路径
import java.io.*; /* n o w j a v a . c o m */ public class Main { public static void main(String[] args) { String filePath = File.separator + "JavaExamples" + File.separator + "IO"; File file = new File(filePath); System.out.println("File path is : " + file.getPath()); } }