Java Reference
In-Depth Information
Review Questions
1.
True or False: An array object can be made smaller, but not larger.
2.
How many String objects are instantiated in memory after the following statement:
String [] values = new String[10];
3.
In the previous question, what is the value of values.length?
4.
Suppose that we declare the following array. What is the value of types[1]?
char [] types = {'a', 'b', 'c', 'd'};
5.
In the previous example, what is the value of types.length?
6.
If a Vector is instantiated with an initial capacity of 20 and a capacity increment of 0,
how many elements can be added to the Vector?
7.
If a Vector is instantiated with an initial capacity of 20 and a capacity increment of 0,
how many elements can be added to the Vector before it needs to be resized? What
will the capacity of the Vector be after the first resizing?
8.
Where does the add(Object) method from the Vector class add the given Object in the
Vector?
9.
Suppose that a Hashtable has a capacity of 50 and a load factor of 0.8. At what point
does the hash table need to grow and be rehashed?
Search WWH ::




Custom Search