如何CLASSPATH下的resource.properties文件进行读写操作?

下面的代码是对resource.properties文件进行读操作:


    Properties props = new Properties();
    InputStream input= this.getClass().getClassLoader().getResourceAsStream("resource.properties");

   try{
           props.load(input);
    }catch(Exception e){
           System.err.println("CheckLogin:不能读取属性文件. " + "请确保resource.properties在CLASSPATH指定的路径中");
    }
    this.midaUser = props.getProperty("User");
    this.midaPassword = props.getProperty("Password");

即分别读取该文件中User和Password的值,现在想对User和Password的值进行修改

你可能感兴趣的:(Java开发)