Properties 示例
来源:互联网 发布:智能网络电视机 编辑:程序博客网 时间:2024/05/17 07:19
/*
为了更大的灵活性,当构造一个属性(Properties)对象时,指定一个默认的属性列表。如果在主列表中没有发现期望的关键字,将会搜索默认列表。
*/
//Use a default property list.
import java.util.*;
class PropDemoDef{
public static void main(String[] args)
{
Properties defList = new Properties();
defList.put("JiLin","ChangChun");
defList.put("ShanDong","JiNan");
Properties capitals = new Properties(defList);
Set provinces;
String str;
capitals.put("JiangSu","NanJing");
capitals.put("LiaoNing","ShenYang");
capitals.put("ShanXi","XiAn");
capitals.put("HeBei","ShiJiaZhuang");
//show all provinces and captials in hashtable
provinces = capitals.keySet(); //get set-view of keys
Iterator i = provinces.iterator();
while(i.hasNext()){
str = (String)i.next();
System.out.println("The captial of " + str + " is " + capitals.getProperty(str) + " .");
}
System.out.println();
//JiLin will now be found in the default list.
str = capitals.getProperty("JiLin");
System.out.println("The captial of JiLin is " + str + " .");
}
}
- Properties 示例
- Properties示例
- Velocity.properties配置示例
- 读取properties文件示例
- 简单的log4j.properties示例
- 简单log4j.properties配置示例
- Properties类的使用示例
- 简单log4j.properties配置示例
- JAVA中properties资源调用简单示例
- Log4j.properties配置详解加示例
- Properties的store()方法和load()方法 示例
- Java知识积累——Properties类的使用示例
- Properties的store()方法和load()方法 示例
- log4j.properties,log4j.xml配置文件的配置示例
- Properties
- properties
- Properties
- PROPERTIES
- 如何在VS2003中编译STLPort-4.6.2
- ASP的时间函数
- Commons Configuration 介绍
- 格式化DataGrid的例子【将数据源中的0,1值或者逻辑值转换成实际的文字】
- 我看激情世界杯 - 2
- Properties 示例
- 为DataGrid添加确认删除的对话框(1)
- 最简洁的清除空行正则 - 文本软件 /RegExp/ By Stabx
- 为DataGrid添加确认删除的对话框(2)
- 为DataGrid添加确认删除的对话框(3)
- Java简单类型进行精确浮点数运算
- ASP 获取 ACCESS 中新插入数据的 ID 或多个ID /Getting last insert ID/ By Stabx
- Microsoft Windows XP Service Pack 2 中的功能变更
- Jun 15 2006 DailyWrite