首页javadirectoryJava I/O - 如何获取当前工作目录

Java I/O - 如何获取当前工作目录

我们想知道如何获取当前工作目录。
    

public class Main {
  public static void main(String[] argv) throws Exception {

    String curDir = System.getProperty("user.dir");
  }
}