Professional Documents
Culture Documents
Java How To Program, 5/e Test Item File 1 of 5
Java How To Program, 5/e Test Item File 1 of 5
Java How To Program, 5/e Test Item File 1 of 5
Chapter 17
Section 17.1
17.1 Q2: File processing programs are generally implemented in Java as __________.
a.Applets.
b.Multithreaded programs.
c.Applications.
d.Interfaces.
ANS: c. Applications.
Section 17.2
Section 17.3
17.3 Q3: How do methods setIn, setOut and setErr affect the standard input, output and error streams?
a.They wrap the streams around another stream.
b.They toggle the buffering capability of these streams.
c.They redirect the standard input, output and error streams.
d.They flush these streams’ buffers.
ANS: c. They redirect the standard input, output and error streams.
© Copyright 2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
Java How to Program, 5/e Test Item File 2 of 5
c.PrintStream.
d.BufferedOutputStream.
ANS: c. PrintStream.
Section 17.4
Section 17.5
17.5 Q2: When displayed, a JFileChooser dialog does not allow the user to interact with any other program
window until the JFileChooser dialog is closed. Dialogs that behave in this fashion are called __________
dialogs.
a.Synchronized.
b.Modal.
c.Median.
d.Choice.
ANS: b. Modal.
© Copyright 2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
Java How to Program, 5/e Test Item File 3 of 5
17.5 Q4: Instance variables that are not to be output with that object are declared using which keyword?
a.private.
b.temporary.
c.transient.
d.ignore.
ANS: c. transient.
Section 17.6
17.6 Q1: RandomAccessFile method __________ repositions the file-position pointer to any position in the file.
a.seek .
b.search.
c.serve.
d.set.
ANS: a. seek.
Section 17.7
Section 17.8
© Copyright 2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
Java How to Program, 5/e Test Item File 4 of 5
Section 17.9
17.9 Q1: When a RandomAccessFile stream is associated with a file, data is read or written beginning at the
location in the file specified by the __________.
a.File-location pointer.
b.Read/write pointer.
c.File-position pointer.
d.Transaction pointer.
ANS: c. File-position pointer.
Section 17.10
Section 17.11
17.11 Q1: Which statement about sorting with direct access techniques is false?
a.It can be blazingly fast compared to the bubble sort.
b.It uses storage efficiently.
c.It uses large amounts of storage relative to the actual space needed to hold the items being sorted.
d.If often wastes storage.
ANS: b. It uses storage efficiently.
17.11 Q2: Which statement is false? Open a file with the "r" mode …
a.To be able to read from the file.
b.To prevent unintentional modification of the file's contents.
c.To implement the "principle of least privilege."
d.To allow writing only at the end of the file.
ANS: d. To allow writing only at the end of the file.
Section 17.12
© Copyright 2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
Java How to Program, 5/e Test Item File 5 of 5
( No questions )
Section 17.13
17.13 Q2: Which buffer operation sets the limit to the position and then sets the position to 0?
a.flip.
b.reset.
c.rewind.
d.clear.
ANS: a. flip.
© Copyright 2003 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.