java中,File类的构造方法中,File(String praret,String child)和File(File f,String child)有什么区别?

File(File f,String child) 在实例化对象时,该怎么写代码??
2025-02-26 20:54:09
推荐回答(3个)
回答1:

File(File f, String child)
根据f 抽象路径名和 child 路径名字符串创建一个新 File 实例。
f抽象路径名用于表示目录,child 路径名字符串用于表示目录或文件
f - 父抽象路径名
child - 子路径名字符串

File(String parent, String child)
根据 parent 路径名字符串和 child 路径名字符串创建一个新 File 实例。
parent 路径名字符串用于表示目录,child 路径名字符串用于表示目录或文件
parent - 父路径名字符串
child - 子路径名字符串

回答2:

aaa

回答3:

~~