If I have three classes. One class `A`, one class `Customer` where I've put an `ArrayList` of `A` in the constructor and one class `SavingsAccount` where I want to put them together. In class `A` I have a method which I want to call from `SavingsAccount`. How do I do that? And to call for both `Customer` and `SavingsAccount`?
In `Customer` there is a variable; `SocSecNr`, that has to match a `Nr` in `SavingsAccount`, to be correct in `A`, that's why I put an `ArrayList` of `SavingsAccount` in `Customer`.
(This is just an example class. I only want to know how to do this call without inheritance)

```
import java.util.ArrayList;

public class A {
private ArrayList<Customer> customerlist;
private SavingsAccount account;

public A() {
    customerlist = new ArrayList<Customer>();
    account = new SavingsAccount();
}

public boolean deposit(long pNr, int accountId, double amount)
{   
    for(int i = 0; i < customerlist.size(); i++)
    {
        if(customerlist.get(i).getPCode() == pNr)
        {
            account.transaction(amount);
        }        
    }
    return false;        

}
public double transaction(){

    if(amount < 0 && balance + amount < 0)
        return -0;
    else
        return balance += amount;
}

   public class Customer {
private long pNr;
private ArrayList<SavingsAccount> accounts;

public Customer(long pCode)
{
    pNr = pCode;
    accounts = new ArrayList<SavingsAccount>();
}

public ArrayList<SavingsAccount> getAccount(){
    return accounts;
}
}

public class SavingsAccount {
private double balance;

public SavingsAccount(){
    accountId = accountCount;
}

public double transaction(double amount){
    if(amount < 0 && balance + amount < 0)
        return -0;
    else
        return balance += amount;

}
}

```