Basic Classes for Input/Output in Java

In Java (as in most object-oriented languages), classes are designed with specific, well-defined behavior. The input/output classes are a classic example of this philosophy.

The Source of the Data

The ASCII/Unicode Dichotomy

Buffering the Input

Opening and Reading a File

Thus, to open a file for input, one would:

Accessing the I/O Classes

In order to work conveniently with the I/O classes, you must place the statement
import java.io.*;
at the beginning of your source file (think of it as analogous to a #include-- we'll go into more detail later).