java tutorial - How to Get parent directory of the file or directory in Java - java programming - learn java - java basics - java for beginners
Learn java - java tutorial - Get parent directory of the file or directory - java examples - java programs
Get parent directory of the file or directory:
- The java.io.File.getParent() method returns the pathname is string or null and this path name is not a parent directory name.
- In Java File getParent() method returns the path name string of the parent directory named of this abstract path name, or null and this pathname is not a parent name.
- getParentFile(): Method returns the parent directory as a File object, or null and this File object is not a parent directory.
- Following is the declaration for java.io.File.getParent() method