2013年10月12日

摘要: JDK在java.text包中,提供了对显示对象格式化的接口、类及异常处理,这里我们只来谈一谈text包中 的format类及其子类。其中,最重要的是两个差不多互为“逆运算”的方法format(将某对象按设定格式化为字符串)与parse(将字符串反格式 化为对象)。 阅读全文
posted @ 2013-10-12 23:09 ONLY LOVE PROGRAME 阅读(461) 评论(0) 推荐(0)
摘要: JAVA格式化时间日期 public class Test{ public static void main(String []args){ Date d = new Date(); String s; /** Date类的格式: Sat Apr 16 13:17:29 CST 2006 */ System.out.println(d); System.out.println("******************************************"); /** getDateInstance() */ /** 输出格式: 2006-4-16 */ s = DateFormat.getDateInstance().format(d); System.out.println(s); /** 阅读全文
posted @ 2013-10-12 22:57 ONLY LOVE PROGRAME 阅读(146) 评论(0) 推荐(0)
摘要: String.format 方法使用介绍 阅读全文
posted @ 2013-10-12 22:45 ONLY LOVE PROGRAME 阅读(269) 评论(0) 推荐(0)

导航