Java 实例 - 查看系统根目录
Java 教程
· 2019-02-11 08:44:26
以下实例演示了使用 File 类的 listRoots() 方法来输出系统所有根目录:
Main.java 文件
import java.io.*;
class Main{
public static void main(String[] args){
File[] roots = File.listRoots();
System.out.println("系统所有根目录:");
for (int i=0; i < roots.length; i++) {
System.out.println(roots[i].toString());
}
}
}
以上代码运行输出结果为:
系统所有根目录: C:\ D:\ E:\ F:\ G:\ H:\
点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html
Head First Web Design
Ethan Watrall、Jeff Siarto / O’Reilly Media, Inc. / 2009-01-02 / USD 49.99
Want to know how to make your pages look beautiful, communicate your message effectively, guide visitors through your website with ease, and get everything approved by the accessibility and usability ......一起来看看 《Head First Web Design》 这本书的介绍吧!
图片转BASE64编码
在线图片转Base64编码工具
随机密码生成器
多种字符组合密码