mgcIT
asked on
RandomAccessFile get current path
can I create a RandomAccessFile and use the path that the current app (.class file) is running in?
for example :
RAF = new RandomAccessFile("Menu.txt ", "r");
where Menu.txt is in the same folder as the class files that the app is currently running from.
Thanks
for example :
RAF = new RandomAccessFile("Menu.txt
where Menu.txt is in the same folder as the class files that the app is currently running from.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
via the classpath, class files are found via the class loader
Use following code to get hold of the location of the current class file
assuming MYClass is the class name
this.class.getResource("MY Class.clas s").toStri ng()
assuming MYClass is the class name
this.class.getResource("MY
ASKER