How to get Current working Directory in java ?

To get current directory location we can use user.dir property

System.getProperty("user.dir")

Example

package com.pretech;
public class CurrentDirectory {
	public static void main(String[] args) {
		System.out.println("Current Directory :"
				+ System.getProperty("user.dir"));
	}
}

No comments:

Post a Comment

Confusion Matrix + Precision/Recall (Super Simple, With Examples)

  Confusion Matrix + Precision/Recall (Super Simple, With Examples) 1) Binary Classification Setup Binary classification means the model p...

Featured Posts