A good answer might be:

Vector csClass = new Vector( 15, 5 ) ;
Rough estimates are good enough. It is better to overestimate the capacity slightly than to underestimate it. A few unused slots do not hurt.

Capacity and Size

A Vector object has a capacity and a size. To find out the current capacity of a Vector use its capacity() method. To find out the current size of a Vector use its size() method.

  • The capacity is the number of slots available.
  • The size is the number of slots that have data in them.
  • Slots 0 up through size-1 have data in them.
  • You cannot skip slots; before slot N gets data, slots, 0, 1, 2, ... N-1 must be filled with data.

The elements of a Vector are accessed using an integer index. As with arrays, the index is an integer value that starts at 0.

  • For retrieving data from a Vector the index is 0 to size-1.
  • For setting data in a Vector the index is 0 to size-1.
  • For inserting data into a Vector the index is 0 to size.
    • When you insert data at index size, you are adding data to the end of the Vector.
(These rules will be explained in detail in a few pages.)

QUESTION 6:

What is the value of the following boolean expression?

myVector.size() <= myVector.capacity()

Click Here after you have answered the question