`

java.lang.String.format

    博客分类:
  • J2SE
阅读更多
冰山一角:
String.format("%1$03d", 1)


public void testTwo(){
		Properties pros = System.getProperties();
		/*Enumeration enumeration = pros.propertyNames();
		while(enumeration.hasMoreElements()){
			System.out.println(enumeration.nextElement());
		}*/
		Set<String> sets = pros.stringPropertyNames();
		Iterator<String> it = sets.iterator();
		int num = 1;
		while(it.hasNext()){
			System.out.println(String.format("%1$03d", num) + " : " + it.next());
			num++;
		}
	}
分享到:
评论

相关推荐

    Can't find a codec for class java.math.BigDecimal.txt

    解决mongo数据插入时 报错问题 mogodb插入数据时报错Can't find a codec for class java.math.BigDecimal

    Java 加减乘除工具类(解决精度损失问题)

    * @return java.lang.String * @author xm * @create 2018/6/7 12:03 **/ public static String format2point(Number value) { return df.format(value); } public static Double add(Number value1, ...

    php-java-bridge 配置包

    $s = new Java( "java.lang.String" , "php-java-bridge config...&lt;br&gt; " ); echo $s ; // demonstrate property access print 'Java version=' . $system -&gt;getProperty( 'java.version' ). ' ' ; print...

    xx.rar_Do You

    build the md5 by concat the strings together, then you can use the java.lang.String.format method. But in Camel 2.0 we have added two convenient methods in the Java DSL so you can do fromF and toF ...

    java写的将字符串中的中文转化为拼音等一系列方法

    format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); format.setVCharType(HanyuPinyinVCharType.WITH_V); char[] input = inputString.trim().toCharArray(); String output = ""; try { for ...

    ognl表达式java使用案例详解(测试通过)

    2、支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路径)]@[方法名 | 值名],例如:@java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3、支持赋值操作和表达式串联...

    Java开发技术

    支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路径)]@[方法名 | 值名],例如:@java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3. 支持赋值操作和表达式串联,如...

    OGNL表达式语言.txt

    支持类静态方法调用和值的访问,表达式的格式为@[类全名]@[方法名|值名],例如:@java.lang.String@format(‘foo %s’,’bar’) ? 操作集合对象。 Ognl有一个上下文(Context)的概念,其实就是一个Map结构,...

    汉字转拼音

    import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import ...

    java pdf 查看器

    import java.lang.reflect.InvocationTargetException; /** * A demo PDF Viewer application. */ public class PDFViewer extends JFrame implements KeyListener, TreeSelectionListener, PageChangeListener...

    java常用工具类的使用

    Date bir=format.parse(birthday); System.out.println(bir); } catch (ParseException e) { ① // TODO Auto-generated catch block e.printStackTrace(); } } } 代码解析: ① 用SimpleDateFormat解析日期...

    OGNL表达式struts2标签

    2、支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路)]@[方法名 | 值名],例如: @java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3、支持赋值操作和表达式串联,...

    java时间处理工具类--DateUtils

    /** * @(#)DateUtil.java * ... public static Date strToDate(String dateStr, String format) { Date date = null; if (dateStr != null && (!dateStr.equals(""))) { DateFormat df ...

    Excel POI读取封装(文件+示范代码)

    import java.lang.reflect.Field; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql....

    JAVA时间处理类

    return format.format(getSystemDate()); } /** * Nヶ月後の当月の最初の日を取得する * * @param n * Nヶ月後 * @return Nヶ月後の当月の最初の日 */ public static Calendar getMonthFirstDay(int n...

    jsp探针 ver0.1

    private final String windowsParseMacAddress(String ipConfigResponse) throws java.text.ParseException { String localHost = null; try { localHost = java.net.InetAddress.getLocalHost().getHostAddress(); ...

    java编写的计算器,能实现加减乘除

    import java.lang.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; import java.awt.Component.*; import java.awt.color.*; import java.text.DecimalFormat; //*************...

    servlet2.4doc

    Overrides the standard java.lang.Object.clone method to return a copy of this cookie. containsHeader(String) - Method in class javax.servlet.http.HttpServletResponseWrapper The default behavior of ...

Global site tag (gtag.js) - Google Analytics