YouTip LogoYouTip

Dir Current

# Java Example - View Current Working Directory [![Image 3: Java Example](#) Java Examples](#) The following example demonstrates using System's getProperty() method to get the current working directory: ## Main.java file class Main{public static void main(String[]args){String curDir = System.getProperty("user.dir"); System.out.println("Your current working directory is :" + curDir); }} The output of the above code is: Your current working directory is :/www/java [![Image 4: Java Example](#) Java Examples](#)
← Data QueueDir Hierarchy β†’