//文件移动
try {
File f=new File("123.txt");
if (f.renameTo(new File("test\\123.txt"))) {
System.out.println("移动成功!");
} else {
System.out.println("移动失败!");
}
} catch (Exception e) {
// TODO: handle exception
System.out.println("移动失败!");
}
//文件移动
try {
File f=new File("123.txt");
if (f.renameTo(new File("test\\123.txt"))) {
System.out.println("移动成功!");
} else {
System.out.println("移动失败!");
}
} catch (Exception e) {
// TODO: handle exception
System.out.println("移动失败!");
}