Week 11

 

Trees – continued (chapt. 10, very high level)

 

General Objects

 

 

File I/O

·        Reading and writing from a file

·        Use

FileReader fileIn           = new FileReader(<filename>);

BufferedReader input  = new BufferedReader(fileIn);

 

Then:

// to read the next integer

int n = input.readInt();   

// to read a string

String line = input.readLine();

// to throw away the rest of an input line and go to the next line

input.readLine();