Java Reference
In-Depth Information
6 . When an array object is instantiated, its elements are initialized to their
default values.
7 . Arrays that are created, that is, instantiated, during program execution are
called dynamic arrays.
8 . Arrays can be initialized when they are created.
9 . A public ( final ) instance variable length is associated with each array
that has been instantiated (that is, for which memory has been allocated to
store the data). The variable length contains the size of the array.
10 . If an array index goes out of bounds, the program throws an
ArrayIndexOutOfBoundsException .
11 . The base address of an array is the address (that is, memory location) of the
first array element.
12 . Arrays can be passed as parameters to methods.
13 . In a method call statement, when passing an array as an actual parameter,
you use only its name.
14 . Individual array elements can be passed as parameters to methods.
15 . The sequential search searches the array sequentially starting from the first
array element.
16 . You can create an array of objects.
17 . The syntax to declare a variable length formal parameter is:
dataType ... identifier
18 . A method can have both a variable length formal parameter and other
formal parameters.
19 . A method can have, at most, one variable length formal parameter.
20 . If a method has both a variable length formal parameter and other types of
formal parameters, then the variable length formal parameter must be the
last formal parameter of the formal parameter list.
21 . The most recent version of Java provides a special type of for loop, called a
foreach loop, to process the elements of an object, such as an array.
22 . The syntax to use a foreach loop to process the elements of an array is:
for (dataType identifier : arrayName)
statements
where identifier is a variable and the data type of identifier is the
same as the data type of the array elements.
23 . A two-dimensional array is an array in which the elements are arranged in a
table form.
24 . To access an element of a two-dimensional array, you need a pair of
indices: one for the row position and one for the column position.
25 .
In row processing, a two-dimensional array is processed one row at a time.
Search WWH ::




Custom Search