Arrays Flashcards
1
Q
What are Arrays of objects initialized to?
A
Null.
This is not the same as nothing.
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.
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.
4
Q
Can an array of Objects hold an array of integers?
Object [ ] o = new int [10];
A
No, of course not.
5
Q
Is an array of integers an Object?
Object obj = new int [ ] { 1, 2, 3 };
A
Why yes, it is.
6
Q
What will the isArray( ) method of an array class return?
A
True.