Write an expression whose value is a reference to a newly created PrintWriter object associated with a file named “message.log”. The PrintWriter object should be created so that existing content in the file is not destroyed or overwritten, but rather output will be appended to any existing content.(Do not concern yourself with any possible exceptions here– assume they are handled elsewhere.)

LANGUAGE: JAVA

CHALLENGE:

Write an expression whose value is a reference to a newly created PrintWriter object associated with a file named “message.log”. The PrintWriter object should be created so that existing content in the file is not destroyed or overwritten, but rather output will be appended to any existing content.(Do not concern yourself with any possible exceptions here– assume they are handled elsewhere.)

SOLUTION:


new PrintWriter("message.log")