package com.heima.exception;
import java.io.File;
import java.io.IOException;
public class test {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
/* File file = new File("F://000");
String[] arr = file.list();
for (String string : arr) {
if (string.endsWith(".doc")) {
System.out.println(string);
}
} */
//demo();
File file = new File("F:/000/计算机网络.doc");
System.out.println(file);
System.out.println(file.exists());
}
private static void demo() {//File file
File parent = new File("F:\\000");
String son = "计算机网络.doc";
File file = new File(parent,son);
System.out.println(file);
System.out.println(file.exists());
}
}
|
|