摘要:
在C中可以使用类似printf(“%d %8.2f\n”, 1001, 52.335)的方法实现格式化输出,可是Java中的System.out.println()并没有对应的功能。要格式化输出,必须使用java.text包中的类来实现类似的操作(要不怎么体现面向对象的优越性呢,不过据说jdk1.5准备又补上)。当然了,java.text包的功能还是很强大的,奇怪的是很多书中都没有涉及,而一般... 阅读全文
posted @ 2007-01-03 01:06
ahuo
阅读(507)
评论(0)
推荐(0)
摘要:
java.text 包允许通过与特定语言无关的方式格式化文本消息、日期和数值。 1. 数据格式化相关类介绍 类 功能介绍 java.util.* Locale 表示一个语言和区域的特定组合 ResourceBundle ListResourceBundle PropertyResource... 阅读全文
posted @ 2007-01-03 00:54
ahuo
阅读(4048)
评论(0)
推荐(0)
摘要:
import java.util.*; import java.text.*; public class fmat { public static void main(String[] args) { Date now = new Date(); DateFormat df = DateFormat.getDateInstance(); DateFormat df1 = D... 阅读全文
posted @ 2007-01-03 00:51
ahuo
阅读(303)
评论(0)
推荐(0)
摘要:
JVMJVM启动后,JVM会设置一些系统属性以表明JVM的缺省区域。user.language,user.region,file.encoding等。 可以使用System.getProperties()详细查看所有的系统属性。如在英文操作系统(如UNIX)下,可以使用如下属性定义强制指定JVM为中文环境-Dclient.encoding.override=GBK -Dfile.encoding=... 阅读全文
posted @ 2007-01-03 00:39
ahuo
阅读(3947)
评论(0)
推荐(0)
摘要:
class chinese { public static void main(String[] args) { byte []by=new byte[64]; String temp=""; int len=0; try { len=System.in... 阅读全文
posted @ 2007-01-03 00:38
ahuo
阅读(527)
评论(0)
推荐(0)
浙公网安备 33010602011771号