- 论坛徽章:
- 0
|
System.out.println("************test StringTokenizer************");
String a="welcome your my friend!";
StringTokenizer s=new StringTokenizer(a,"e");
int cnt=s.countTokens();
System.out.println("count is: "+cnt);
for(int i=0;iprop.put("put", "function extend from Hashtable");//插入一条
prop.setProperty("setProperties", "function in Properties");
prop.store(new FileOutputStream("corejava//ApplicationResources.properties",true),"hehe" );//保存
en=prop.keys();//取出所有的key,继承自Hashtable的方法
while(en.hasMoreElements()){
a=(String)en.nextElement();
System.out.println(a+": "+prop.getProperty(a));
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/36006/showart_278773.html |
|