Click here to watch in Youtube :
FileDemo.java
Click the below link to download the code:FileDemo.java
import java.io.File;
import java.io.IOException;
public class FileDemo
{
public static void main(String[] args) throws IOException
{
File tempFile = File.createTempFile("temp", ".txt");
/*
* Will give you the full complete path name
* (filepath + filename) of a file.
*/
String absolutePath = tempFile.getAbsolutePath();
System.out.println("File path : " + absolutePath);
}
}
OutputFile path : C:\Users\Ramesh\AppData\Local\Temp\temp5613613809025056166.txt
No comments:
Post a Comment