zoukankan      html  css  js  c++  java
  • Java(7)_file类的常用方法

    package com.bowen.dong;
    
    import java.io.File;
    
    /**
     * 
     * @author bw
     * @version1.0
     */
    public class FileTest {
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            // System.out.println("bowen");
            File file=new File("D:\英语\100句.docx");
            System.out.println("文件目录是否存在:"+file.exists());
            System.out.println("是否是文件:"+file.isFile());
            System.out.println("是目录吗?:"+file.isDirectory());
            System.out.println("文件名称:"+file.getName());
            System.out.println("文件路径:"+file.getPath());
        }
    }

                file.getPath(); getName(); isFile(), exists(); String[] s=f.list()
                这些方法不要记,敲代码时可以根据API或者是提示选择自己需要的

  • 相关阅读:
    (四)rsync未授权访问
    (前言一)HTTP报文
    (一)会话固定攻击
    使用Burp、PhantomJS进行XSS检测
    win10配置环境变量
    java学习网站http://how2j.cn/
    镜像下载
    jQuery
    jQuery
    jQuery
  • 原文地址:https://www.cnblogs.com/sunnybowen/p/9853484.html
Copyright © 2011-2022 走看看