Suppose our application is in package abc and we use Ystem.getProperty("user.dir"); I get path as E:\jdk1.3.1\demo\applets\Clock and not E:\jdk1.3.1\demo\applets\Clock\abc can any one tell me how to get the programmatically package name of the class in which we are working
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
posted 15 years ago
Try URL url = getClass().getResource("."); File directory = new File(url.getFile()); if you want the directory. The full package name is in getClass().getName(), if that's all you want.