testformat.java

来自「MM7彩信对接网关示例」· Java 代码 · 共 35 行

JAVA
35
字号
/*
 * Created on 2004-1-8
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package com.rainbow.util.tools;

/**
 * @author liu_hongshan
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class TestFormat {

	public TestFormat() {
		super();
	}

	public static void main(String[] args) {
		int i = 9;
		String s1 = dddd();
		System.out.println(
			Format.sprintf(
				"This is %s %s %d %f",
				new Object[] { s1, "Test", new Integer(i), new Float(3.1)}));
	}

	private static String dddd() {
		String s1 = "a";
		return s1;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?