

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
Material Type: Notes; Professor: Sussman; Class: PROG LANG TECH & PDGMS; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CMCS 433, Spring 2002 - Alan Sussman 2
CMCS 433, Spring 2002 - Alan Sussman 3
CMCS 433, Spring 2002 - Alan Sussman 4
CMCS 433, Spring 2002 - Alan Sussman 5
int[] array1 = {1, 3, 5}; int[][] a = new int[10][3]; // a.length == 10 // a[7].length == 3
a[5][2] = 42; a[9] = array1; // a[9][2] == 5
// use of array initializers int[][] twoD = {{1, 2, 3}, {4, 5}, {6}}; Object [] args = {“one”, “two”, a}; main(new String [] {“a”, “b”, “c”}); CMCS 433, Spring 2002 - Alan Sussman 6
public static void printArray(Object [] a) { for (int i = 0; i < a.length; i++) System.out.println(“a[“ + i + “] = “ + a[i]); }
CMCS 433, Spring 2002 - Alan Sussman 7
CMCS 433, Spring 2002 - Alan Sussman 9
CMCS 433, Spring 2002 - Alan Sussman 10
CMCS 433, Spring 2002 - Alan Sussman 11