In this section, you will study how to obtain the absolute path of a particular file. For this, we have define a file 'MainClass.java'. The method file.getAbsolutePath() returns the absolute path of the given file.
Here is the code of GetAbsolutePath.java
import java.io.File;
|
Output will be displayed as:

|
Recommend the tutorial |
Ask Questions? Discuss: Java get Absolute Path
Post your Comment