Check out example codes for "creating file in specific location in java application". It will help you in understanding the concepts better.

Code Example 1

String path = "C:" + File.separator + "hello" + File.separator + "hi.txt";
// Use relative path for Unix systems
File f = new File(path);

f.getParentFile().mkdirs(); 
f.createNewFile();

Learn ReactJs, React Native from akashmittal.com