WDD 330 portfolio
Week 02
Notes
-
Callbacks are quite interesting. Is it possible to invoke as many callbacks
as necessary in the same function? Can any callbacks be used inside other callbacks?
-
A "Foreach" loop repeats one or more actions on each array item and works only on
arrays.
-
Array: An array is a special variable, which can hold more than one value at a time.
Questions
-
Can any callbacks be used inside other callbacks?
Code Examples
//create array
int[] array1 = {1, 2, 3, 4, 5, 6, 7, 8 };
//print each element in array
for(int i = 0; i < array1.length; i=i+1){ System.out.println(array1[i]); }
var car1 = "Saab";
var car2 = "Volvo";
var car3 = "BMW";