Java技术收集很多各种技术总结

源代码在线查看: reading and writing a properties file(from sun).txt

软件大小: 2575 K
上传用户: justsohappy
关键词: Java
下载地址: 免注册下载 普通下载 VIP

相关代码

				作者:jeru
				email: jeru@163.net
				日期:8/5/2001 5:16:09 PM
				Reading and Writing a Properties File
				
				 
				 // Read properties file.
				 
				 Properties properties = new Properties();
				 try {
				     properties.load(new FileInputStream(
				       "infilename"));
				 } catch (IOException e) {
				 }
				     
				 // Write properties file.
				 
				 try {
				     properties.store(new FileOutputStream(
				       "outfilename"), null);
				 } catch (IOException e) {
				 }
				 
				 
				Here is an example of the contents of a properties file: 
				     # a comment
				     ! a comment
				     
				     a = a string
				     b = a string with escape sequences \t 
				              \n \r \\ \" \' \ (space) \u0123
				     c = a string with a continuation line \
				         contination line
				     d.e.f = another string
				 
							

相关资源