- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveFile.java
More file actions
Latest commit
26 lines (24 loc) · 581 Bytes
/
Copy pathMoveFile.java
File metadata and controls
26 lines (24 loc) · 581 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
packagesepidsal;
importjava.io.File;
/**
*
* @author Sepideh Saljooghi
*/
publicclassMoveFile {
publicstaticvoidmain(Stringargs[]){
try{
Filef = newFile("D:\\sepidsal.txt");
Filenf = newFile("D:\\Folder1\\Folder2\\Folder3\\sepidsal.txt");
if(f.renameTo(nf)){
System.out.print("File Moved!");
}
else
{
System.out.print("Nothing For Move!");
}
}
catch(Exceptione){
System.out.print(e);
}
}
}