COMS W1004 Lecture Notes - Lecture 9: Arri
Document Summary
Ways to declare and initialize an array of integers. 1 int ci arr i = new int c 33 ; for l int i - oi i s arm . length i itt l l. Arri ci ] = it ti filling array. 2 . int ci arr 2 = el. Id array an array within an array int l il ] arr 3 = new int 121123 i. Filling a 2b array for ( int i - O because we know at least one row ) 12 * it , it ; system . out . print in carril ; (cid:8869) " automatically calls to string 11. [ i @ 5 act 9800 unique identifier printed by default to string 11. To fix this : we can use a for loop to print array contents for ( int i = o i i s arri - length ; it t l l.