8. Input and Output

In most cases, input and output is the ultimate goal of an application. An application is only useful if it can spit out results and take in user or machine generated input to process. In this chapter, we cover basic phrases for performing input and output.

The java.io and java.util packages are home to most of the classes that we will use in this chapter for performing input and output tasks. In this chapter, we will show you how to read and write files, work with zip archives, format your output, and work with the standard operating system streams.

As you read the phrases in this chapter, keep in mind that many of the phrases have the possibility of throwing exceptions such as the java.io.IOException in any real program. ...

Get Java™ Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.