Ike said:
Suppose I have a Vector of Vectors, to which I wish to add another Vector of
Vectors. Can someone show me what that looks like in code? Thanks, Ike
If you start by defining what it means (in this homework) to add one
Vector of Vectors to another then you'll be halfway there. For
instance, should the result be a Vector that contains all the Vectors
from the two operands? Or do you need some kind of component-wise
addition of the inner Vectors? Something else?
After you know what you need to do, examine Vector's API docs to find
useful methods to help you accomplish it. Don't [in general] neglect
methods inherited from superclasses. Depending on exactly what you want
to do, it could be as simple as one line of code.
There could also be other classes that would help you. Since Vector is
a member of the Java Collections framework, you might consider
consulting the Collections trail of the Java Tutorial.
John Bollinger
(e-mail address removed)