Intro to I/O in Java


Terms

stream
A source for input or a destination for output.
whitespace
Refers to the space, tab, and newline characters.
delimiter
Any character that is used to separate individual tokens.
token
A portion of a string defined by a set of delimiters.
absolute pathname
The directory path to a file location that begins with the root of the directory in which the file is located.
relative pathname
The directory path to a file location that begins with the current working directory.
checked exception
An exception that must be handled or thrown in a program. I/O errors are checked exceptions.
unchecked exception
An exception that may be ignored in a program. Descendents of the RuntimeException are the only unchecked exceptions in java.

Classes you should know

Scanner
Specifically, its use related to input and tokenizing a String.
File
The class to specify file names for both input and output.
PrintWriter
The class used to print to files.
StringTokenizer
A class that can be used to tokenize String objects.

Today's notes

Review solution to Wednesday lab

I/O Basics

Scanner uses

String tokenizer - an introduction

More information about the File class


CS 239 - Spring 2006
Department of Computer Science Nancy Harris Home Page Current Classes Link