java cst时区转换
BODY { color: #000000; font-size: 9pt; font-family: 宋体 }
TABLE { font-size: 9pt; font-family: 宋体 }
SimpleDateFormat sdfy = new SimpleDateFormat("HH:mm");
String tt =
"Tue Feb 09 10:43:00 CST 2010";
sdf = new SimpleDateFormat(
"EEE MMM dd HH:mm:ss 'CST' yyyy", Locale.US);
try
{
System.out.println(sdfy.format(sdf.parse(tt)));
} catch
(ParseException e1) {
// TODO 自动生成 catch
块
e1.printStackTrace();
}
相关文档:
需要dom4j.jar文件 ,自行下载。 test.xml 1: <?xml version="1.0" encoding="gbk"?>
2:
3: <students>
4: <person sex="男" age="21">
5: <id>1</id>
6: <name>章治鹏</name>
7: <homepage&g ......
Introduction to XML and XML With Java
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......
1. 代理模式主要有两种:静态代理和动态代理
2. 静态代理:
比如要在输出“HelloWorld”前打印一个字符串“Welcome”
A:先定义一个接口类
Java代码
package ttitfly.proxy;
public interface HelloWo ......
使用类java.io.File
1.获取系统硬盘信息:
public static String getDiskInfo() {
StringBuffer sb=new StringBuffer();
File[] roots = File.listRoots();// 获取磁盘分区列表
for (File file : roots) {
long totalSpace=file.getTotalSpace();
long freeSpace=file.getFreeSpace();
long usa ......