• IO流(5)判断功能


    判断功能:
    * public boolean isDirectory():判断是否是目录
    * public boolean isFile():判断是否是文件
    * public boolean exists():判断是否存在
    * public boolean canRead():判断是否可读
    * public boolean canWrite():判断是否可写
    * public boolean isHidden():判断是否隐藏
    */
    public class FileDemo {
      public static void main(String[] args) {
        // 创建文件对象
        File file = new File("a.txt");

        System.out.println("isDirectory:" + file.isDirectory());// false
        System.out.println("isFile:" + file.isFile());// true
        System.out.println("exists:" + file.exists());// true
        System.out.println("canRead:" + file.canRead());// true
        System.out.println("canWrite:" + file.canWrite());// true
        System.out.println("isHidden:" + file.isHidden());// false
      }
    }

  • 相关阅读:
    Flink DataStream API
    Flink Time
    Flink Catalog
    Flink window
    Flink如何处理update数据
    Flink on Yarn和k8s
    nginx http转发成https导致post请求变为get请求
    static和extern
    4.曲率计算
    1.距离地图和路径居中
  • 原文地址:https://www.cnblogs.com/qinjf/p/8260955.html
Copyright © 2020-2023  润新知