在d盘中新建a文件夹,里面再次新建b子文件夹,在b文件夹中新建test.txt文件,并输入姓名+年龄。
http://blog.csdn.net/qiaqia609/article/details/11048463
public static void main(String[] args) throws IOException
{
System.out.println("Hello World!");
File file = new File("a/b");
file.mkdirs();
File file1 = new File("a/b/text.txt");
PrintWriter pw = new PrintWriter(file1);
pw.println("姓名+年龄");
pw.close();
}