易截截图软件、单文件、免安装、纯绿色、仅160KB

Java数字转字符串前面自动补0的实现


本文原址:http://blogger.org.cn/blog/more.asp?name=hongrui&id=46926
/**  
 * Java里数字转字符串前面自动补0的实现。  
 *    
 */   
public class TestStringFormat {    
  public static void main(String[] args) {    
    int youNumber = 19;    
    // 0 代表前面补充0    
    // 4 代表长度为4    
    // d 代表参数为正数型    
    String str = String.format("%02d", youNumber);    
    System.out.println(str); // 01    
  }    
}   


相关文档:

java入门

 Java学习从入门到精通 
一、 JDK (Java Development Kit) 
JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握JDK是学好Java的第一步。最主流的J ......

java对mysql数据库的导入导出

//导出
String mysql="mysqldump -uroot -proot  --opt databasename > d:/test.sql";    
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);   
//导入
String mysql="mysqladmin -uroot -proot create databasename";    
java.lang.Runt ......

rxtx取代javax.comm实现Java跨平台设备端口通信

from Rxtx
This page is for general content regarding the use of rxtx. Feel free to add your own content.
Using RXTX In Eclipse
Deploying JAVA with RXTX
I wrote an app several months ago using javax.comm on windows. Sun has left me high and dry. rxtx help!
download ftp://ftp.qbang.org/pub/rx ......

java学习资料站

1、 http://java.sun.com/ ;;(英文)
Sun的Java网站,是一个应该经常去看的地方。不用多说。
2、 http://www-900.ibm.com/developerWorks/cn/ ;;
IBM的developerWorks网站,英语好的直接去英文主站点看。这里不但是一个极好的面向对象的分析设计网站,也是Web Services,Java,Linux极好的网站。强烈推荐!!!
3、 h ......

年底收藏系列 Java安全工具,生成MD5,Base64,UUID


/*
* EncryptUtils.java
* Copyright (C) 2007-3-19 <JustinLei@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号