Java Reference
In-Depth Information
Answers to Review Questions
1.
False. Arrays are not resizable.
2.
Zero. You get a reference to an array (values) and an array of 10 String references, but
no String objects.
3.
10
4.
'b'
5.
4
6.
A Vector is only limited in size by memory constraints. You can add as many elements
as you have room for. The initial capacity and increment are not relevant in this
question.
7.
When the 21st element is added, the Vector will need to be resized. Vectors with a
capacity increment of 0 double in size, so the capacity of the Vector after the 21st ele-
ment is added will be 40.
8.
The add(Object) method adds the given element at the end of the Vector.
9.
50 * 0.80 = 40, so adding the 41st element causes the Hashtable to be resized and
rehashed.
Search WWH ::




Custom Search