A good answer might be:

  1. The int value in answer is transformed into chars (and appended to the string).
  2. Then, as the data is written to disk, the chars are transformed into 8-bit UTF.

Summary of Class FileWriter

Here is a list of some of the constructors and methods used with FileWriter. All of the methods are inherited from its ancestors. For a complete list of methods refer to your on-line documentation.

Constructors

FileWriter(String fileName) 
   An IOException is thrown 
   if the file cannot be created.
            
FileWriter(String fileName, boolean append)            
   An IOException is thrown 
   if the file cannot be created.

Methods

public void close() throws IOException
    Flush the stream and close the file.

public void flush() throws IOException
    Flush the stream.

public void write(String str) throws IOException
    Write a string.

public void write(String str, int off, int len) throws IOException
    Write a portion of a string.
    Parameters:
    str - A String
    off - Offset from which to start writing characters
    len - Number of characters to write

Data might not go immediately to the disk after a write(). The flush() method ensures that data previously written is sent to the disk. The second write() method sends a portion of a string to the file.

QUESTION 11:

Could the user of a program name the file that is created?

Click Here after you have answered the question