CurrentWorkingDirectory.java
package com.javatutorialcorner.directory; public class CurrentWorkingDirectory { public static void main(String[] args) { getCurrentWorkingDirectory(); } private static void getCurrentWorkingDirectory() { String userDirectory = System.getProperty("user.dir"); System.out.println("Present Working Directory : " + userDirectory); } }Output
Present Working Directory : C:\Users\annamalait\workspace\Test143
0 comments:
Post a Comment