久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      java怎么判斷是否為文件

      java怎么判斷是否為文件

      java中可以使用java.io.File.isFile()判讀是否是文件,java.io.File.isFile() 檢查表示此抽象路徑名的文件是否是一個正常的文件。

      以下是java.io.File.isFile()方法的聲明:

      public boolean isFile()

      參數(shù):NA

      返回值

      當(dāng)且僅當(dāng)表示此抽象路徑名的文件是一個文件該方法返回true,否則該方法返回false。

      下面的示例演示java.io.File.isFile()方法的用法

      package com.yiibai;import java.io.File;public class FileDemo {    public static void main(String[] args) {              File f = null;       String path;       boolean bool = false;              try{          // create new file          f = new File("c:");                       // true if the file path is a file, else false          bool = f.isFile();                    // get the path          path = f.getPath();                    // prints          System.out.println(path+" is file? "+ bool);                          // create new file          f = new File("c:/test.txt");                    // true if the file path is a file, else false          bool = f.isFile();                    // get the path          path = f.getPath();                    // prints          System.out.print(path+" is file? "+bool);                 }catch(Exception e){          // if any error occurs          e.printStackTrace();       }    }}

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號