Diagrama de flujo
Understanding Declarations
Contenido del diagrama
ARRAYS
int num[] = {2,4,6,8,10};
This array has 5 elements, of int type, indexed from 0 to 4 (n-1)
at index 0 = 2
at index 1 = 4
at index 2 = 6
at index 3 = 8
at index 4 = 10
String dogs[] = new String[4];
This array, "dogs," has 4 elements of type String. Lets assign values to the array
dogs[0] = "shepherd";
dogs[1] = "dalmatian";
dogs[2] = "beagle";
Because the last index (3) was not assigned a value, the statement dogs[3] references a value of null
An array is declared and initialized in one step
Shows the elements located at each index
Información
- Descripción
- Diagrama sobre Understanding Declarations, creado por Olivia B el 01/06/2018.
- Creado por
- Olivia B
- Visitas
- 1
- Valoración