1/7
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
how to initialize a 2D array
dataType [][] varName = new dataType[row][column] (size of the array)
{{2,3,4}, {3, 4, 5}} to initialize to values
how to access a row in a 2D array?
array name and index number in bracket
how to access a value in a 2D array
name[][]
row-major traversal
(moving left to right and then down)
(row.length {
col[0]. length}}
what does array.length represent?
the NUMBER of rows in an array
what does array[0].length mean?
the number of elements in a row (the number of colums)
column major traversal
reading each column (top to bottom) then shifting right
what is the indexOf(String ch) method?
it tells you the index numbers of the specified string(remeber every string is an array with the characters starting at index 0