I have instance with getters and setters in my Customer Class
private Collection<CustomersDetails> customerDetails = new ArrayList<CustomersDetails>();
public Collection<CustomersDetails> getCustomerDetails() {
return customerDetails;
}
public void setCustomerDetails(Collection<CustomersDetails> customerDetails) {
this.customerDetails = customerDetails;
}
but when i am trying to pass
CustomersDetails customersDetails = new CustomersDetails();
customersDetails.set....
customersDetails.set....
Customer customer = new Customer();
customer.setCustomerDetails(customersDetails);
its giving me error
The method setCustomerDetails(Collection<CustomersDetails>) in the type Customer is not applicable for the arguments (CustomersDetails)
Why its so , when my collection is of CustomersDetails type??