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学习从入门到精通
一、 JDK (Java Development Kit)
JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握JDK是学好Java的第一步。最主流的J ......
/*
* 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
* ......
/*
* 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 ......
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 ......
Java邮件群发器
功能说明:
1、批量循环发送邮件
2、发送HTML文件,待发送的邮件以htm的格式存放,可以是网络上的htm文件,可以是本地的htm文件
3、可以指定发送附件的目录,系统会加载指定目录的全部附件一起发送
4、发送邮件以txt文件保存,每行保存一个邮件 ......