Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Chapter 10
Chapter Contents
Chapter Objectives
10.1 Introductory Example: Weather Data Analysis
10.2 Java/s I/O System: Readers, Writers, Streams
10.3 Exceptions
10.4 More About I/O Streams
10.5 Example: Scanning for a Virus
10.6 Example: Student Data Retrieval
10.7 Graphical/Internet Java: Student Data Retrieval GUI
Part of the Picture: Data Base Systems
Chapter Objectives
Input Output
Stream Stream
Executing Program
Predefined Streams
System.in
– InputStream object, usually for the keyboard
System.out
– a buffered PrintStream object, usually the
screen or an active window
System.err
– an unbuffered PrintStream object usually
associated with the screen or console window
Wrapping Classes
valueString = inFile.readLine():
while (valueString != null)
{ … // process valueString
valueString = inFile.readLine(); }
Exception
Exceptions become
more specialized
Try/Catch Strategy
What is a virus?
– software that hides itself within other executable
programs
– that executable program is the "host" for the virus
– the virus program tries to "infect" other programs
– the virus can cause problems that range from
annoying to malicious
A virus that prints an annoying message stores
that string value within itself
– we will write a program that searches through a file
to find that text, or signature
Virus-Detection Algorithm
Based on data
– accuracy and detail help make better decisions
– large data sets stored on computers