printstream

PrintStream类close()方法 (PrintStream Class close() method)

  • close() method is available in java.io package.

    close()方法在java.io包中可用。

  • close() method is used to close the underlying output stream.

    close()方法用于关闭基础输出流。

  • close() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.

    close()方法是一个非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • close() method does not throw an exception at the time of closing the stream.

    close()方法在关闭流时不会引发异常。

Syntax:

句法:

    public void close();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of the method is void, it returns nothing.

该方法的返回类型为void ,不返回任何内容。

Example:

例:

// Java program to demonstrate the example
// of void close() method of
// PrintStream
import java.io.*;
public class CloseOfPS {public static void main(String[] args) {String str = "Java Programming";
// Instantiates PrintStream
PrintStream p_stm = new PrintStream(System.out);
// Display str
p_stm.println("str: " + str);
// By using close() method is to
// close the stream p_stm
System.out.println("Stream Shutdown....");
p_stm.close();
}
}

Output

输出量

str: Java Programming
Stream Shutdown....

翻译自: https://www.includehelp.com/java/printstream-close-method-with-example.aspx

printstream

printstream_Java PrintStream close()方法与示例相关推荐

  1. java printstream 覆盖了_Java PrintStream clearError()方法与示例

    PrintStream ClassclearError()方法clearError()方法在java.io包中可用. clearError()方法用于清除此PrintStream的内部错误状态. cl ...

  2. printstream_Java PrintStream clearError()方法与示例

    printstream PrintStream类clearError()方法 (PrintStream Class clearError() method) clearError() method i ...

  3. java的flush方法_Java中的BufferedWriter flush()方法及示例

    Java中buffered writer类的flush()方法用于刷新缓冲的writer流中的字符.语法:公共void flush()指定者:此方法由Flushable接口的flush()方法指定.重 ...

  4. .net连接mysql数据_.net连接MYSQL数据库的方法及示例!

    连接MYSQL数据库的方法及示例 方法一: 使用MYSQL推出的MySQL Connector/Net is an ADO.NET driver for MySQL 该组件为MYSQL为ADO.NET ...

  5. set.difference() 的用法(python3)_Python 集合 difference_update() 使用方法及示例

    Python 集合 difference_update() 使用方法及示例 Difference_update()使用集合的差集更新集合,并调用difference_update()方法. 如果A和B ...

  6. doc python 颜色_Python wordcloud.ImageColorGenerator方法代码示例

    本文整理汇总了Python中wordcloud.ImageColorGenerator方法的典型用法代码示例.如果您正苦于以下问题:Python wordcloud.ImageColorGenerat ...

  7. isdigit函数在C语言什么意思,C 库函数 isdigit() 使用方法及示例

    C 库函数 isdigit() 使用方法及示例 isdigit()函数检查字符是否为数字字符(0-9). isdigit()的函数原型int isdigit( int arg ); 函数isdigit ...

  8. python中append的用法_Python 列表 append() 使用方法及示例

    Python 列表 append() 使用方法及示例 append()方法将一个项目添加到列表的末尾. append()方法将单个项目添加到列表的末尾. append()方法的语法为:list.app ...

  9. java kryo_Kryo框架使用方法代码示例

    Kryo框架的source已移至https://github.com/EsotericSoftware/kryo ,进入此页面,然后点击右边的Download Zip按钮,就能下载到最新版本的Kryo ...

  10. python文件的用法,Python 文件 readlines() 使用方法及示例

    Python 文件 readlines() 使用方法及示例 概述 readlines() 方法用于读取所有行(直到结束符 EOF)并返回列表,该列表可以由 Python 的 for... in ... ...

最新文章

  1. android Android build.gradle 配置注释
  2. 一种灵活,坚固且无凝胶的脑电图电极,可用于无创脑机接口
  3. 今日学习心得——装饰模式
  4. Google cpp style guide 之 include
  5. Delphi常见各类编译错误信息-中英对照
  6. 使用jQuery发送POST,Ajax请求返回JSON格式数据
  7. 在 Azure App Service 上启用 Application Request Routing
  8. HDU-4027 Can you answer these queries? --线段树
  9. selection.text
  10. Unity API学习笔记(2)-GameObject的3种Message消息方法
  11. java 多线程 保存txt_一个txt文件,里面存在几万条数据,现用多线程实现数据导入,提高效率,java代码如何实现...
  12. 微信计步器怎么不计步_微信运动不计步,如何解决
  13. 计算机软科排名澳门科技大学,2016年软科中国两岸四地大学排名正式发布
  14. Mac Google Chrome 谷歌浏览器出现:您的连接不是私密连接攻击者可能会试图从 x.x.x.x 窃取您的信息(例如:密码、通讯内容或信用卡信息)。NET::ERR_CERT_INVALID
  15. Linux安装RPM、YUM
  16. 如何关闭Windows蜂鸣器的嘟嘟声
  17. python turtle画圣诞树动图_用 turtle 画一棵圣诞树
  18. html5 vr图片展示,three.js——通过 HTML5 页面呈现 VR 内容
  19. 视频学习笔记------系统学习让你轻松定义 Java 类加载器
  20. Java性能优化推荐书!java原生开发是什么意思

热门文章

  1. oracle 实例死掉,Oracle 监听莫名死掉
  2. 简单有趣的c语言小程序,一个有趣的小程序
  3. 字典排序什么意思_字典排序问题
  4. java匿名对象 回收_Java 匿名对象
  5. mf模型 svd++_序列推荐模型(一): FPMC
  6. python 高级语言特性_Pytohon学习笔记(一)Python编程语言历史及特性
  7. 容器底层实现技术Namespace/Cgroup
  8. 求二叉树节点个数、叶子节点、节点层次与宽度
  9. UOJ#31 【UR #2】猪猪侠再战括号序列
  10. Spring Data Redis实战之提供RedisTemplate