易截截图软件、单文件、免安装、纯绿色、仅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服务端接受get方式传送的汉字转码方法

1.用new String(request.getParameter("name").getBytes("ISO-8859-1"),"GBK") 方式进行转码
2.设置tomcat:在tomcat的conf目录下找到server.xml文件,在Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000" ......

Java Corba实例 (原作者:紫溪)

这篇文章和SUN公司提供的教程类似,中间多了一个HelloImpl的java文件,编译时的命令也就有所不同了
原来的命令为:Server  javac HelloServer.java HelloApp/*.java
                        ......

Java调用 xx.so库

package com.xxx.yyy;
public class kkkEncode
{
    public native static boolean encode(double loIn, double laIn, double[] point);    //声明一个同库一样的方法   
    public native static boolean decode(double loIn, double laIn, double[] p ......

年底收藏系列 Java Web工具CookieSupport

/*
* CookieSupport.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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号