Arrays Flashcards

1
Q

Initializing arrays w/ drudge method:

A

int [ ] temps = new int[3];
temps[0] = 78
temps[1] = 89
temps[2] = 34

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 #");
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Initializing array in 1 line

A

int [ ] temp = {78, 89, 34};

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 #");
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Finding length of an array named “value”

A

value.length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly