Elements are created with the addElement( ... ) method: |
Order missouri = new Order(); |
orders.addElement( missouri ); |
The object missouri of type Order is automatically converted to an Object and added to Vector instance orders defined on the previous foil. |
There are methods for indexing vectors. Like arrays, the indexing is zero-based. |
x = (Typeofx) v.elementAt(i); |
v.setElementAt( x, i ); |
The length of the Vector may also be obtained: |
int size = v.size; |