Java更改/写入Properties

InputStream in=this.getClass().getResourceAsStream("/config.properties");
		Properties ppt=new Properties();
		try {
			ppt.load(in);
			ppt.setProperty(key, value);
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			if(in!=null){
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}


 

你可能感兴趣的:(java,properties,null)