Bad, Better, Best

Bad…what is the data type of the customer ID?

public Customer getCustomer(Object customerId) { ... }

Better…but a null customer ID makes no sense:

public Customer getCustomer(Integer customerId) { ... }

Best:

public Customer getCustomer(int customerId) { ... }

Leave a Reply

Your email address will not be published. Required fields are marked *