Arrays Flashcards
1
Q
Initializing arrays w/ drudge method:
A
int [ ] temps = new int[3];
temps[0] = 78
temps[1] = 89
temps[2] = 34
2
Q
Initializing arrays with for loop
A
int [ ] temps = new int[3]; for(int ctr = 0; ctr less than 3; ctr++) { temps[ctr] = Console read int ("enter #"); }
3
Q
Initializing array in 1 line
A
int [ ] temp = {78, 89, 34};
4
Q
String array w for loop
A
String [ ] list = new String[3]; for(int ctr = 0; ctr less than 8; ctr++) { list[ctr] = Console read int ("enter #"); }
5
Q
Finding length of an array named “value”
A
value.length