In java,
File f;
f = new File("myfile.txt");
if (!f.exists())
{
f.createNewFile();
}
when excute the above code,which path is assigned in default, while specific path is not given?
In java,
File f;
f = new File("myfile.txt");
if (!f.exists())
{
f.createNewFile();
}
when excute the above code,which path is assigned in default, while specific path is not given?
The current directory, which you can get by calling:
new File('.').getCanonicalPath();
The current directory. Apparently System.getProperty("user.dir")
can get this for you.