Random(6) [0, 6)

for ( int num : numbers ) { // statements using num}
// is equivalent to
for ( int i = 0; i < numbers.length; i++ ) { 
int num = numbers[i];
// statements using num
}

A 2D array is a 1D array of (reference to ) 1D arrays

Screen Shot 2021-10-12 at 11.51.00 AM.png

Many more useful static methods in Java.lang.Math class

Untitled

Untitled

A method’s parameters are considered to be local variables of that method and can be used only in that method’s body.

Method Call Stack

If a series of method calls occurs, the successive return addresses are pushed onto the stack in last-in, first-out order

The program-execution stack also contains the memory for the local variables used in each invocation of a method

◦ Stored in the activation record (or stack frame,活动记录) of the method call