Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Design - Interview Questions and Answers for 'Prototype design pattern' - 2 question(s) found - Order By Newest | ||||
| ||||
Ans. It make sense only if we intend to modify either of the object and would like to preserve original state in other. Otherwise we can reuse the original object by making it singleton. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  clone  clone objects  prototype design pattern   immutable  immutability  immutability  cloning | ||||
Related Questions | ||||
What are different ways of object creation in Java ? | ||||
How to avoid cloning, serialization in the singleton class ? | ||||
What is a cloneable interface and what all methods does it contain? | ||||
Name few classes that implement Cloneable interface ? | ||||
Why do we use a copy constructor ? | ||||
Why Collection interface does not extend Cloneable interface ? | ||||
What is a prototype design pattern ? | ||||
Difference between shallow copy and object cloning ? | ||||
What is cloning in GIT ? | ||||
Frequently asked Design Pattern interview question. | ||||
| ||||
Ans. The prototype pattern is a creational design pattern. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. Prototype is used when we need duplicate copies of objects. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  design pattern  prototype design pattern  cloning Asked in 11 Companies intermediate | ||||
Related Questions | ||||
What is the difference between Singleton and Prototype Bean scope in Spring ? | ||||
What are design situations to use Singleton and Prototype Design Pattern ? | ||||
When should we use prototype scope and singleton scope for beans ? | ||||
Does it make sense to clone an object which is supposed to be immutable ? | ||||
Can we use Prototype Bean scope with Autowiring ? | ||||