Java中InputStream.close()具有什么功能呢?
下文笔者讲述java中InputStream.close()方法的功能简介说明,如下所示:
InputStream.close()方法的功能:
用于关闭并且释放流资源
----------------------------------
InputStream.close()方法的语法:
public void close()
返回值说明
此方法不返回任何值
异常说明
IOException:I/O错误
例
public static void main(String[] args) throws Exception
{
InputStream is = null;
try
{
InputStream is = new FileInputStream("D://java265.txt");
}
catch(Exception e)
{
}
finally
{
if(is != null) is.close();
}
}
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。


