Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago

Question

=+ Are there closed-shop requirements or practices?

Answered: 1 week ago