Deepak Bala wrote:Both calls perform the same action functionally.
"append" and "write" are the same, you mean. Yes, they are, they're identical. "append(c)" exists just to satisfy the "Appendable" interface, and is implemented by calling this.write(c).
Your two examples are
not the same. If you use the FileWriter constructor with just one argument, the file is immediately truncated to zero bytes; the original contents are lost. If you use the two-argument version and pass "true", however, then the file's contents are left intact.