inside the properties there are a few keys and "test" is one of them, if I set fout to true, it will append the whole properties file below without the removed key. But if I don't set fout to true, all the keys and values wil be removed.
What do you mean by "set fout to true"? fout is an outputstream, not a boolean variable.
BTW, the properties store() method, just writes the basic properties out to the stream. If the original property file had an ordering, comments, and extra line spaces for readability, they will all be gone. In other words, if you store(), don't expect the property file to be nicely formatted anymore.
Henry