close
import java.io.File;
import java.io.IOException;
public class NewClass {
public static void main(String[] args) throws IOException {
File f = new File("萌.mp4");
System.out.println("絕對路徑 : " + f.getAbsolutePath());
System.out.println("路徑 : " + f.toPath());
System.out.println("URI : " + f.toURI());
System.out.println("URI + ASCII : " + f.toURI().toASCIIString());
}
}
輸出結果:
絕對路徑 : C:\Users\Loli\Documents\NetBeansProjects\My Test\萌.mp4
路徑 : 萌.mp4
URI : file:/C:/Users/Loli/Documents/NetBeansProjects/My%20Test/萌.mp4
URI + ASCII : file:/C:/Users/Loli/Documents/NetBeansProjects/My%20Test/%E8%90%8C.mp4
全站熱搜
留言列表