I have 2 classes
public class Customer{
...
public String getCustomerNumber();
...
}
public class Applicant{
....
private Customer c;
public Cust
One way to workaround this issue would be to define custom list types like this:
class CustomerList extends ArrayList {
...
}
class ApplicantList extends ArrayList {
...
}
Then the following overloading would be legal:
public void processCustomerNumbers(CustomerList custList)
public void processCustomerNumbers(ApplicantList appList)
However, I don't think that this would be a good idea. For a start, it hardwires particular implementation classes into your application's APIs.
A better approach is to define a common interface for Customer and Applicant that allows you to process them with one processCustomerNumbers
method. (As described at length in other answers.)