Given the fragment:public class CustomerApplication {public static void main (String [] args) {CustomerDAO custDao = new

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899559
Joined: Mon Aug 02, 2021 8:13 am

Given the fragment:public class CustomerApplication {public static void main (String [] args) {CustomerDAO custDao = new

Post by answerhappygod »

Given the fragment:public class CustomerApplication {public static void main (String [] args) {CustomerDAO custDao = new CustomerDAOMemoryImp1 ();// . . . other methodsWhich two valid alternatives to line 3 would decouple this application from a specific implementation of customerDAO?

A. CustomerDAO custDao = new customerDAO();
B. CustomerDAO custDao = (CustomerDAO) new object();
C. CustomerDAO custDao = CustomerDAO.getInstance();
D. CustomerDAO custDao = (CustomerDAO) new CustomerDAOmemoryImp1(); E. CustomerDAO custDao = CustomerDAOFactory.getInstance();
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!

This question has been solved and has 1 reply.

You must be registered to view answers and replies in this topic. Registration is free.


Register Login
 
Post Reply