Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Which of the following statements about using the PrintWriter object with a file name is correct? If the output file already exists, the existing

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

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

If the output file does not exist, an IllegalArgumentException will occur

5. Which of the following is NOT a typical usage of a Scanner object.

Format output for display to the screen
Parse individual data fields directly from a String in memory

Read input from the keyboard

Read and parse a file from local storage

7. Which of the following statements about a PrintWriter object is true?

No data loss will occur if the program fails to close a PrintWriter before exiting.
Data loss may occur if a program fails to close a PrintWriter object before exiting.
A PrintWriter will be automatically closed when the program exits.
An exception will occur if the program fails to close a PrintWriter before exiting.

8.

One of the main points of exception handling in Java is to separate detection and handling of errors. Which of the following is NOT an advantage of this technique?

Allows centralization of error handling
Allows decentralization of error detection
Can enforce a strict linear execution path
Can ensure certain resources are implicitly closed

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago