码迷,mamicode.com
首页 > 其他好文 > 详细

保存属性到普通的属性文件中

时间:2014-09-09 10:47:48      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:style   color   io   java   ar   文件   on   c   new   

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class PropertiesDemo02 {
    public static void main(String[] args) {
        Properties pro = new Properties();
        pro.setProperty("BJ", "bEIJING");
        pro.setProperty("TJ", "TJIANJIN");
        pro.setProperty("DJ", "TOKYO");
        File file = new File("E:" + File.separator + "area.properties");
        try {
            pro.store(new FileOutputStream(file), "ARea Info");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

保存属性到普通的属性文件中

标签:style   color   io   java   ar   文件   on   c   new   

原文地址:http://www.cnblogs.com/vonk/p/3961319.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!