Java StringWriter class is a character stream that collects output from string buffer, which can be used to construct a string.
The StringWriter class extends the Writer class.
In StringWriter class, system resources like network sockets and files are not used, therefore closing the StringWriter i...