mam 2 klasfunkcja Przeciążenie Java z List <> parametru
public class Customer{
...
public String getCustomerNumber();
...
}
public class Applicant{
....
private Customer c;
public Customer getCustomer(){ return c; }
...
}
Kiedy prezentowane z listy klientów lub wnioskodawców chcę funkcję, która wykonuje iteracje listę i robi coś z CUSTOMERNUMBER.
Próbowałem przeciążania funkcji
public void processCustomerNumbers(List<Customer> custList)
...
public void processCustomerNumbers(List<Applicant> appList)
...
ale są one postrzegane jako duplikatów metod ... czy jest to dobry sposób na osiągnięcie tego raczej niż tylko o 2 różnie nazwane funkcje?
Dobra sugestia. –