新聞中心
FileNotFoundException

java.lang.Object
|---java.lang.Throwable
|---|---java.lang.Exception
|---|---|---java.io.IOException
|---|---|---|---java.io.FileNotFoundException
public class FileNotFoundException
extends IOException
表示嘗試打開(kāi)由指定路徑名表示的文件失敗的信號(hào)。
當(dāng)具有指定路徑名的文件不存在時(shí),F(xiàn)ileInputStream、FileOutputStream 和 RandomAccessFile 構(gòu)造函數(shù)將引發(fā)此異常。 如果文件確實(shí)存在但由于某種原因不可訪問(wèn),例如當(dāng)試圖打開(kāi)只讀文件進(jìn)行寫(xiě)入時(shí),這些構(gòu)造函數(shù)也會(huì)拋出它。
Since:
JDK1.0
構(gòu)造函數(shù)摘要
| 構(gòu)造函數(shù) | 描述 |
|---|---|
| FileNotFoundException() | 構(gòu)造一個(gè)以 null 作為其錯(cuò)誤詳細(xì)消息的 FileNotFoundException。 |
| FileNotFoundException(String s) | 使用指定的詳細(xì)消息構(gòu)造 FileNotFoundException。 |
方法總結(jié)
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 從類 java.lang.Throwable 繼承的方法 |
|---|
| addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
構(gòu)造函數(shù)詳細(xì)信息
FileNotFoundException
public FileNotFoundException()
構(gòu)造一個(gè)以 null 作為其錯(cuò)誤詳細(xì)消息的 FileNotFoundException。
FileNotFoundException
public FileNotFoundException(String s)
使用指定的詳細(xì)消息構(gòu)造 FileNotFoundException。 字符串 s 可以稍后通過(guò) java.lang.Throwable 類的 Throwable.getMessage() 方法檢索。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| s | 詳細(xì)信息。 |
新聞標(biāo)題:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSFileNotFoundException
文章分享:http://fisionsoft.com.cn/article/cccjhge.html


咨詢
建站咨詢
