O'Reilly logo

Programming with Java by Sunil Patekar, Mahesh Bhave

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

CHAPTER 11

SIMPLE INPUT/OUTPUT

Modern computers have many input/output (i/o) devices. Any modern programming language should provide methods to work with them. Java is no exception. However, at this stage, we will discuss only conventional devices like keyboard and monitor. We will discuss files in a separate chapter. These days most of the programs use GUI. Input/output techniques for these applications will be discussed later.

At this stage, we will concentrate only on console input/output.

11.1 Concepts of Streams, Stream Classes

From the days of C language, input/output is made stream based. The data is supposed to flow as a stream. Languages support methods to work with these streams.

When data flows from input device to computer (CPU to ...

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