13.5 格式化输出
来源:互联网 发布:知花作品全集 编辑:程序博客网 时间:2024/06/10 19:00
package com.cnsuning.src;public class Main {public Main() {// TODO Auto-generated constructor stub}public static void main(String[] args) {Main m = new Main();m.testPrintF();}public String toString(){//这里不能使用this来作为当前地址输出, 因为编译器会调用this.toString进行类型转换, 其结果就是循环调用, 会产生异常return "class address is "+super.toString();}public void testPrintF(){System.out.printf("test is [%d,%f]",2,5.3);System.out.format("test is [%d,%f]",2,5.3);}}
test is [2,5.300000]test is [2,5.300000]
0 0
- 13.5 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 格式化输出
- 13.2 重载"+"与StringBuilder
- 修改IIS 设置让下载INI文件
- Trie树
- Setter类的属性
- Linux环境下配置php开发环境(我转载的原因是里面有我要的配置虚拟主机的提示)
- 13.5 格式化输出
- gstreamer编译环境
- python简单的多人聊天室
- 13.5.4 格式化说明符
- property基础介绍
- LoadRunner-遇到的问题及解决方法
- leetcode-Reverse Linked List II
- 13.5.5 Formatter转换
- Jenkins 系列文章总结得比较好