



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Lecture notes for the java programming course (cmsc 433) taught by alan sussman at the university of maryland, fall 2001. The notes cover various topics including constructors, interacting with the external environment, packages, files, wrapper classes, strings, string buffers, exceptions, and inner classes.
Typology: Study notes
1 / 5
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