About Question enthuware.ocpjp.v7.2.1096 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
erbegu
Posts: 5
Joined: Thu Mar 06, 2014 9:29 am
Contact:

About Question enthuware.ocpjp.v7.2.1096 :

Post by erbegu »

As "getStudentDAO()" is static, isn't this also Singleton pattern? Just to clarify, thanks.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1096 :

Post by admin »

No, this is not a singleton pattern. You may read about Singleton pattern here: https://blogs.oracle.com/JavaFundamenta ... loops_with

hamada.yamasaki
Posts: 17
Joined: Fri Oct 11, 2013 10:31 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1096 :

Post by hamada.yamasaki »

Isn't it mandatory that factory pattern must take some type param in order to constuct an object?
for. e.g.
public class DAOManager{          
public static StudentDAO getStudentDAO(String type){         return new StudentDAOJpaImpl();     }      }

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1096 :

Post by admin »

No, it is not mandatory for a factory pattern to take some parameter.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests