java 构建File对象、相对路径和绝对路径概念
更新:HHH   时间:2023-1-7


String path="C:/Users/10853/eclipse-workspace/hell/linux学习路线.png";

    //通过完整路径构建File对象
    File f =new File(path);
    //通过父路径和子路径构建File对象
    f=new File("C:/Users/10853/eclipse-workspace/hell","linux学习路线.png");
    //通过父抽象方法路径和子路径构建File对象
    f=new File(new File("C:/Users/10853/eclipse-workspace/hell"),"linux学习路线.png");

相对路径:不存在盘符
绝对路径:存在盘符"C:",

返回编程语言教程...