溫馨提示×

java怎么獲取當前路徑

小億
98
2024-02-29 13:56:47
欄目: 編程語言

在Java中,可以使用`System.getProperty("user.dir")`來獲取當前工作目錄的路徑。示例如下:

```java

public class GetCurrentPath {

public static void main(String[] args) {

String currentPath = System.getProperty("user.dir");

System.out.println("Current working directory is: " + currentPath);

}

}

```

運行該程序將會輸出當前工作目錄的路徑。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女