



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




CMCS 433, Fall 2001 - Alan Sussman 2
CMCS 433, Fall 2001 - Alan Sussman 3
CMCS 433, Fall 2001 - Alan Sussman 5
CMCS 433, Fall 2001 - Alan Sussman 7
import java.io.*; public class Echo { public static void main(String [] args) { String s; BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); int i = 1; try { while((s = in.readLine()) != null) System.out.println((i++) + “: “ + s); } catch(IOException e) { System.out.println(e); } } }
CMCS 433, Fall 2001 - Alan Sussman 9
CMCS 433, Fall 2001 - Alan Sussman 10
CMCS 433, Fall 2001 - Alan Sussman 11
CMCS 433, Fall 2001 - Alan Sussman 12
CMCS 433, Fall 2001 - Alan Sussman 19
CMCS 433, Fall 2001 - Alan Sussman 20
CMCS 433, Fall 2001 - Alan Sussman 21
CMCS 433, Fall 2001 - Alan Sussman 23
CMCS 433, Fall 2001 - Alan Sussman 24
class MyOwnException extends Exception {} class MyClass { void oops() throws MyOwnException { if (some_error_occurred) { throw new MyOwnException(); } } }
CMCS 433, Fall 2001 - Alan Sussman 25
CMCS 433, Fall 2001 - Alan Sussman 27