



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!




Homework h1 due 10 pm tomorrow, February 7th Homework h2 assigned tomorrow Program p1 due 10 pm Sunday, February 16th
Handin directories have been created. Assignment questions? Post on Piazza or see a TA during lab consulting hours.
Last Time Exceptions
Today Exceptions
Next Time Chains of Linked Nodes
Checked vs. Unchecked
Java Syntax
... methodName ( parameter list ) throws ExceptionType1, ExceptionType2, ... { ... }
Example
public static void main(String[] args) throws IOException { ...
Primitives
int x, y, z; x = 7; y = x; z = x; y = 10; z = 8;
References
ArrayList
Primitives
Given:
void mod1(int x) { x = 7; }
Execute (assume in main):
int x = 1; int[] y = {1, 2, 3}; mod1(x); mod1(y[2]);
References
Given:
void mod2(int[] x) { x[0] = 7; }
void mod3(int[] x) { x = new int[x.length]; x[0] = 14; }
Execute (assume in main):
int[] a = {1, 2, 3}; mod2(a); mod3(a);
Edit
Compile
Run