Java%20Design%20Patterns%20Interview%20Questions%20and%20Answers
Question: What is main benefit of using factory pattern? Where do you use it?Answer: Factory pattern’s main benefit is increased level of encapsulation while creating objects. If you use Factory to create object you can later replace original implementation of Products or classes with more advanced and high performance implementation without any change on client layer. |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is design patterns?
- Can you name few design patterns used in standard JDK library?
- What is Singleton design pattern in Java ? write code for thread-safe singleton in Java.
- What is main benefit of using factory pattern? Where do you use it?
- What is observer design pattern in Java?