w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Folder and file are not getting created by Java code under Linux, but it works for Windows

You can use the static field File.separator or, better, use the nio Paths class like this:

File f = Paths.get( "dir1", "dir2", "dir3" ).toFile();

To get something to refer to the absolute path, start the String arguments with a File.separator, which you might get also with nio with this method:


© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.