The Single Responsibility Principle

Which of the following code snippets follows the Single Responsibility Principle?

Options
  1. public class CustomerOrder {

public void createCustomer(int customerId, String name) {

}

2. public void submitOrder(Cart shopCart) {

Order order = orderProcessor.submitOrder(shopCart.getItems());

}

}

3.

Related Posts

Close Bitnami banner
Bitnami