Home : Tutorials : Java Tutorial


revised: 9/26/98; 7/30/99; 01/17/00; 06/01/00

CHAPTER 10 — Input and Output

To be useful, a program must input data and output the results of processing that data. This chapter discusses some easy ways to input and output data from the keyboard and monitor. Input and output operations are a very complicated aspect of computers (and computer programming languages), so this chapter is just a beginning.

Chapter Topics:

  • Input and Output Streams.
  • The standard IO streams.
  • Exceptions
  • InputStreamReader and BufferedReader Classes.
  • Converting character data to type int.

Note: If you are reading a Java textbook and are also following these notes you may find that your text book uses its own methods for doing input from the keyboard. This is OK, You can still use these notes. The methods used in these notes are part of the JDK (Java Development Kit) and will work for every Java installation. The methods in your textbook are (probably) unique to that book and require you to use a special package written by the book's author. Those methods are based on the methods in the JDK and are fundamentally the same as the methods used in these notes.

QUESTION 1:

When a computer program does an input operation, in which direction does the data flow?

  • From an outside device into the program?
  • From the program out to some device?

Home : Tutorials : Java Tutorial

 

Copyright© 1998-2004 All Rights Reserved. No portion of this site may be reproduced or redistributed without prior written permission from VistaEdge Technologies

All registered trademarks appearing on this site are the property of their respective owners. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. This site is not connected to Sun Microsystems, Inc. and is not sponsored by Sun Microsystems, Inc.