Given the fragment: Which two valid alternatives to line 3 would decouple this application
from a specific implementation of CustomerDAO?
A.
CustomerDAO custDao = CustomerDAO.getInstance();
B.
CustomerDAO custDao = (CustomerDAO) new CustomerDAOmemoryImp1();
C.
CustomerDAO custDao = (CustomerDAO) new Object ();
D.
CustomerDAO custDao = CustomerDAO();
E.
CustomerDAO custDao = customerDAOFactory.getInstance();
Why B is incorrect?
Because in this case there is the dependence of specific implementation – CustomerDAOMemoryImpl1. The correct answer is A, E
answer is b and e
baecause CustomerDAOMemoryImpl1 has implemented CustomerDAO
I’m really loving the theme/design of your blog. Do you ever run into any internet browser compatibility problems? A small number of my blog readers have complained about my blog not operating correctly in Explorer but looks great in Safari. Do you have any advice to help fix this issue?|
I quite like looking through a post that will make people think. Also, many thanks for allowing me to comment!|