3a initialSize = 3; 3b line 7 [0 -]--> null [1 -]--> null [2 -]--> null line 17 [0 -]--> "string 0" [1 -]--> "string 1" [2 -]--> null line 27 [0 -]--> "string 0" [1 -]--> "string 1" [2 -]--> "string 2" [3 -]--> "string 3" [4 -]--> null line 50 [0 -]--> "string 0" [1 -]--> "string 1" [2 -]--> "string 3" [3 -]--> "string 4" . . . [7 -]--> "string 8" [8 -]--> "string 9" [9 -]--> null [10-]--> null line 62 [0 -]--> "string 0" [1 -]--> "string 7" [2 -]--> "string 8" [3 -]--> "string 9" [4 -]--> null [5 -]--> null [6 -]--> null 3c sizes are: 3, 7, 11, 7 3d The capacity() method returns the size of the internal array used for storage. Hence, its a measure for the current memory usage of the list (but not of how much memory the list's elements take!). Also note that the number returned says nothing about the current number of elements stored as the ratio between the array size and the number of items stored is dependent on how conservative the add()/remove() are. 3e The size() returns the current number of stored elements. The number returned can never be below zero. Also note that storing massive number of elements breaks with the fact that size() can "only" return numbers of size 2^31. Albeit this is more of an academic problem than founded in reality. A long could be used instead of an int, but eventually you will run into the same problem. 3g the get(int i) method returns the i'th stored element (provided it exists). Notice the return type is Object, hence a cast is most likely needed in conjunction with the method call. i.e. Person p = (Person) v.get(1) as Person p = v.get(1) fails. 3h remove(int i) removes the i'th stored (provided it exists). A removal may trigger a re-allocation of the internal array used for storing elements. Such a re-allocation and copying of pointers is somewhat time consuming, but it reduces memory usage. This is a classical example of the battle between efficiency and memory usage. If you know vectors are always short-live, you can do without the re-allocation part of remove()..on the other hand if the remove() was less eager to re-allocate (i.e. only did it if 50% of the array slots were empty) the time spent on re-allocation is minimal (amortizised to zero) except for really special case situations where you add/remove one element continously triggering first an expansion re-allocation, then a reduction re-allocation, then an expansion re-allocation and so forth.. 3i toString() returns a string representation of the vector by getting a string representation of all the stored elements and merging these into one big string which is returned by the method. 3j MyVector(int incrementSize, int initialSize) { this.capacityIncrement = incrementSize; this.initialSize = initialSize; elements = new Object[ initialSize ]; } note that this is only an exercise! The incrementSize should normally not be a fixed number. Instead it should be the size of the current size of the array storing the elements as this usually reduces the number of re-allocations while keeping memory usage reasonably adjusted. 3k public boolean isEmpty() { return size() == 0; } note the method is prefixed with the name "is". It is a good practise for methods returning a boolean to be formulated as a question. This removes ambiguities which sometimes arises when using other peoples code (as they can have a different mind-set than you). 3l public void clear() { size = 0; elements = new elements[initialSize]; } simply set the number of elements to be 0 and re-allocate the internal array with the size of the initialSize variable. 3m public boolean contains(Object element) { for(int i = 0; i < size; i++) // examine all elements if(elements[i] == element) // element found return true; return false; // element not found in list } 3n public void set(ind index, Object obj) { if(size >= index) elements[index] = obj; else throw new Error("Index out of bound"); } 3o public void add(int index, Object obj) { if(size >= index) { // ensure the internal array is big enough to hold one more element, if not expand the array as in add() if( elements.length < (size+1) ){ Object[] newArray = new Object[ elements.length + capacityIncrement ]; for( int n = 0; n < elements.length; n++ ) newArray[n] = elements[n]; elements = newArray; } // shift all elements one place (note this could be done above as well) // but since we do it here, we have to remove from the end of the array down to // place 'index' otherwise we will corrupt the array content for(int i = size; i > index; i--) elements[i+1] = element[i]; // add the new object elements[index] = obj; size = size +1; } else throw new Error("index out of bound"); } } 3p (not included)