Factory pattern is one of the most used design patterns in Java. This type of design pattern come under creational pattern as this pattern provides one of the best ways to build an objective.
In Factory pattern, we build entity without exposing the creation logic to the customer and refer to newly produced object using a universal interface.
We're obtainable to create a Shape interface and concrete classes implementing the form interface. A factory class Shape Factory is define as a next step.
FactoryPatternDemo, our presentation class will use Shape Factory to get a Shape article. It will pass information (CIRCLE / RECTANGLE / SQUARE) to form Factory to get the type of entity it needs.
Create an interface.
Make concrete classes implementing the similar interface.
Construct a Factory to create object of concrete class based on given information.
Apply the Factory to get entity of material class by momentary an information such as kind.
Prove the output.
Design Patterns Related Interview Questions
|Java Script Interview Questions||AJAX Interview Questions|
|Graphic Design Interview Questions||Adobe Indesign Interview Questions|
|Java-Multithreading Interview Questions||Database Design Interview Questions|
|Compiler Design Interview Questions||CSS Advanced Interview Questions|
|Java Design Patterns Interview Questions||Hardware design Interview Questions|
|Material Design Lite Interview Questions||Object Oriented Analysis and Design Interview Questions|
|Standard Template Library (STL) Interview Questions|
Design Patterns Tutorial
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.