Arrays Flashcards

1
Q

What are Arrays of objects initialized to?

A

Null.

This is not the same as nothing.

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

Can a superclass reference be assigned to a subclass reference variable?

A

Yes, but only if it is derived from the superclass. Even then it needs a cast.

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

Can you put array size information on the left hand side of an asignment operator?

char foo[2][1] = new char [ ] [ ] { {‘b’, ‘a’}, {‘r’} };

A

Good God, no.

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

Can an array of Objects hold an array of integers?

Object [ ] o = new int [10];

A

No, of course not.

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

Is an array of integers an Object?

Object obj = new int [ ] { 1, 2, 3 };

A

Why yes, it is.

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

What will the isArray( ) method of an array class return?

A

True.

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