O'Reilly logo

Java I/O, NIO and NIO.2 by Jeff Friesen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix    A

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

  1. The API categories that comprise classic I/O are File, RandomAccessFile, the stream classes, and the writer/reader classes.
  2. 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.
  3. The API categories that comprise NIO are buffers, channels, selectors, regular expressions, charsets, and a printf-style formatting facility based mainly on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required