Tuesday 26 August 2014

Get the User home directory

Use the property "user.home" to get the user home directory.

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

Output
C:\Users\Krishna


                                                             Home

No comments:

Post a Comment