In this section, you will study how to obtain the name of file.
In order to get the file name, we have provided the path of file 'Hello.txt" to the constructor of class File. The method getName() returns the name of the file directory denoted by the pathname.
Here is the code of GetFileName.java
Output will be displayed as:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: October 24, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles