Question: 1. If an input/output resource is not closed properly, what are the consequences (if any)? a. Additional memory is needed for buffering, but data is

1. If an input/output resource is not closed properly, what are the consequences (if any)?

a. Additional memory is needed for buffering, but data is neither lost nor delayed.
b. Data could be lost.
c. No data is lost, but its processing is be delayed until the resource times out.

d. There are no practical consequences; it is just a very poor practice.

2. What is recommended if the standard library does not have an exception class that describes your particular error situation?

a. Choose RuntimeException from the standard library because it is unchecked and represents a generic exception.
b. Design your own exception class as a subclass of an existing exception class.
c. Design your own exception class by implementing the Throwable interface.
d. Design your own exception class as a superclass of an existing exception class.

3.

Which of the following statements about using the PrintWriter object with a file name is correct?

a. If the output file already exists, the existing data will be discarded before new data are written into the file.
b. If the output file already exists, the new data will be appended to the end of the file.
c. If the output file does not exist, a FileNotFoundException will occur.
d. If the output file does not exist, an IllegalArgumentException will occur.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!