CS 56 Advanced Java Programming
Week 4
Agenda
Chapter 17 - Files and Streams
Test1 - see Week 3 web page for info
References
Introduction to Java Programming
, Elliotte Rusty Harold,
Week 10, Input and Output with Streams
Thinking in Java
,
Bruce Eckel, Chapter 10: The Java IO system
Examples
Echo.java
- echoes back what the user types at the console; uses
InputStream
methods
HelloOutputStream.java
- writes "Hello World"; uses
OutputStream
methods
Type.java
- reads files named on command line and prints them on
System.out
; uses
FileInputStream
class
MultiType.java
- reads user input from
System.in
and writes it into the files specified on the command line; uses
FileOutputStream
class
FileInfo.java
- reads filenames from the command line and returns various information about those files; uses the
File
class
Pictures
Byte Streams in java.io
Character Streams in java.io
Lab17
Exercise 17.11; classname
WordGenerator
.
<
CS 56
>
Home
Email
Last Modified September 20, 2001