Tuesday 26 August 2014

Get the User working directory

Use the property "user.dir" to get the user working directory.

public class GetProperty {
    public static void main(String args[]){
        System.out.println(System.getProperty("user.dir"));
    }
}

Output
C:\Users\Documents\NetBeansProjects\samples


                                                             Home

No comments:

Post a Comment