Java 实例 - 查看当前工作目录
Java 教程
· 2019-02-11 08:59:36
以下实例演示了使用 System 的 getProperty() 方法来获取当前的工作目录:
Main.java 文件
class Main {
public static void main(String[] args) {
String curDir = System.getProperty("user.dir");
System.out.println("你当前的工作目录为 :" + curDir);
}
}
以上代码运行输出结果为:
你当前的工作目录为 :/www/java
点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html
Tales from Facebook
Daniel Miller / Polity Press / 2011-4-1 / GBP 55.00
Facebook is now used by nearly 500 million people throughout the world, many of whom spend several hours a day on this site. Once the preserve of youth, the largest increase in usage today is amongst ......一起来看看 《Tales from Facebook》 这本书的介绍吧!