I was unable to understand the following file constructors.
public File(String parent, String child) and
public File(File parent, String child)
Let's explain with some examples:
Assuming that you have the following structure:
/dir1
dir11
The constructor that you usually use new File("/dir1/dir11")
is equivalent to
new File("/dir1", "dir11")
(constructor taking 2 String
as arguments)
and also equivalent to
new File(new File("/dir1"), "dir11")
(constructor using a File
as first argument).