Code example for Vector

Methods: setElementAt, size

0
        transactions.add(t); 
    } 
 
    public void replaceLastTransaction(Transaction t) 
    { 
        transactions.setElementAt(t, transactions.size() - 1); 
    } 
 
    public void setTransactions(Vector<Transaction> transactions) 
    { 
        this.transactions = transactions; 
    } 
 
    private Vector<Transaction> transactions; 
}