易截截图软件、单文件、免安装、纯绿色、仅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的设计原则
 
 
1.    接口隔离原则(ISP:Interface Segregation Principle)
定义:使用多个专门的比使用单一的总接口要好。也可以说:建立单一接口,不要建立臃肿庞大的接口。
ISP的两种定义:
◇ “Clients should not be forced to depend upon interfaces that they don't u ......

IBM Java 面试题

1.what is oracle.
2.what is major differenece oracle8i and oracle9i.
4.tell me some thing ur self.
5.please tell me about oops.
6.what is single inheritance.
7.what is multiple inheritance.
8.can java support multiple inheritance.
9.what is interface.
10.what is differenec between abstract c ......

年底收藏系列 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
* ......

年底收藏系列 Java Web工具SessionTick

package org.lambdasoft.web.support;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import org.lambdasoft.web.Enviroment;
public class SessionSupport {
private SessionS ......

让用户不必安装JRE运行java程序

1、将项目打包好;
2、将JRE目压缩成JRE.rar,放在当前项目目录下;
2、下载GreenJVM,其中两个主要文件(GreenJVM.exe和vm.cfg)
3、用计事本打开vm.cfg设置参数,参数很多,只要设置下面几个就可以用了:
    SET_VM_NAME=jre.rar
    SET_START_JAR_PATH=***.jar   &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号