Answers to Exercises
Each of Chapters 1 through 14 closes with an “Exercises” section that tests your understanding of the chapter’s material. The answers to those exercises are presented in this appendix.
Chapter 1: I/O Basics and APIs
- The API categories that comprise classic I/O are File, RandomAccessFile, the stream classes, and the writer/reader classes.
- The benefit of the try-with-resources statement is a reduction in verbosity. You can use this statement to automatically close open files and other resources instead of having to provide this resource-closing code.
- The API categories that comprise NIO are buffers, channels, selectors, regular expressions, charsets, and a printf-style formatting facility based mainly on the ...