Java Formatter out()方法与示例
格式化程序类out()方法 (Formatter Class out() method)
out() method is available in java.util package.
out()方法在java.util包中可用。
out() method is used to get Appendable for the output.
out()方法用于获取输出的Appendable。
out() method is a non-static method, it is accessible with the class object and if we try to access the method with the class name then we will get an error.
out()方法是一种非静态方法,可通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
out() method may throw an exception at the time of returning destination for the output.
在返回输出的目标位置时, out()方法可能会引发异常。
FormatterClosedException: This exception may throw when this Formatter close by calling its close() method.
FormatterClosedException :当此Formatter通过调用其close()方法关闭时,可能会引发此异常。
Syntax:
句法:
public Appendable out();
Parameter(s):
参数:
It does not accept any parameter.
它不接受任何参数。
Return value:
返回值:
The return type of this method is Appendable, it returns Appendable for the output.
此方法的返回类型为Appendable ,它为输出返回Appendable。
Example:
例:
// Java program is to demonstrate the example of
// out() method of Formatter
import java.util.*;
public class OutOfFormatter {public static void main(String[] args) {// Instantiates a StringBuffer and Formmatter object
StringBuffer sb = new StringBuffer();
Formatter formatt = new Formatter(sb, Locale.UK);
// By using format() method is to format
// a string
formatt.format("Hi %s !", "IncludeHelp");
// Display Formatted String
System.out.println(formatt);
// By using out() method is to
// return the output formatted by
// this Formatter
System.out.println("formatt.out(): " + formatt.out());
}
}
Output
输出量
Hi IncludeHelp !
formatt.out(): Hi IncludeHelp !
翻译自: https://www.includehelp.com/java/formatter-out-method-with-example.aspx
Java Formatter out()方法与示例相关推荐
- Java IOUtils.copy方法代码示例(亲测)
本文整理汇总了Java中org.apache.commons.io.IOUtils.copy方法的典型用法代码示例.如果您正苦于以下问题:Java IOUtils.copy方法的具体用法?Java I ...
- java formatter 填充_Java Formatter format()方法及示例
格式化程序类format()方法 语法:public Formatter format(Locale lo, String frmt, Object... args); public Formatte ...
- java user directory,Java ProcessBuilder directory()方法与示例
语法:public File directory (); public ProcessBuilder directory (File dir); ProcessBuilder类directory()方 ...
- Java序列化魔术方法及其示例使用
在上一篇文章中, 您需要了解有关Java序列化的所有知识 ,我们讨论了如何通过实现Java序列化来启用类的可序列化性. Serializable接口. 如果我们的类未实现Serializable接口, ...
- catalog java,Java Connection getCatalog()方法与示例
通常,目录是一个目录,其中包含有关数据集,文件或数据库的信息.而数据库目录中包含所有数据库,基本表,视图(虚拟表),同义词,值范围,索引,用户和用户组的列表. Connection接口的getCata ...
- filepermission java,Java FilePermission getActions()方法与示例
FilePermission类getActions()方法getActions()方法在java.io包中可用. getActions()方法用于检查此FilePermission和给定对象在路径名和 ...
- java方法参数Bundle,Java ResourceBundle keySet()方法及示例
ResourceBundle类keySet()方法keySet()方法在java.util包中可用. keySet()方法用于从此ResourceBundle及其超级捆绑包中获取所有现有键,以在Set ...
- java exec waitfor,Java Process waitFor()方法与示例
流程类waitFor()方法在java.lang包中提供了waitFor()方法. waitFor()方法用于使当前正在运行的线程在需要时等待,直到由该Process对象表示的进程完成其终止为止. 当 ...
- java arraylist.add(),Java ArrayList add()方法与示例
ArrayList类add()方法 语法:public boolean add(T ele); public void add(int indices, T ele);add()方法在java.uti ...
- java rollback用法,Java Connection rollBack()方法与示例
回滚操作将撤消当前事务所做的所有更改,即,如果调用Connection接口的rollBack()方法,则所有修改都将还原到最后一次提交. 您还可以通过将所需的Savepoint对象作为参数传递给此方法 ...
最新文章
- TVM优化c++部署实践
- emwin之基于某个事件或标志创建某个界面的一种方法
- yum安装与源码编译安装实际使用区别
- 王思聪欠款1.5亿成被执行人 孙宇晨:我帮你还钱!
- Python 之 %s字符串、%d整型、%f浮点型
- Linux中shell脚本获取当前工作目录
- php验证手机号码 函数,PHP 匹配电话,手机,400号码 函数 及正则。很管用。
- 湖工微型计算机及原理题目,2017年湖北工业大学电气与电子工程学院942微机原理与应用考研导师圈点必考题汇编...
- 万能视频格式转换器 v 2018 全能版
- 来自白菜【强烈推荐】最新淘宝零食店铺排行榜 零食控最爱逛的淘宝零食店
- unity3D用鼠标和射线控制物体移动(一)
- 前端作业(一)——我在《世纪佳缘注册页面》作业中遇到的问题
- 较好用的待办清单软件有哪些 电脑待办清单事项管理便签下载
- 皮尔森相关性系数的计算python代码(一)
- 微信小程序跳转公众号
- BuuCTF_crypto(2021.10.8新-->旧)
- ubuntu系统安装安卓模拟器(Android SDK)的方法
- 正则表达式(BREs,EREs,PREs)差异比较
- 计算机辅助三维诊断英文,人体CT图像的三维可视化(英文)
- linux vim插件