4. What do you mean by a prototype? Define analysis
prototype
Answer Posted / som shekhar
Prototype is creational design pattern similar to abstract
factory pattern.
Most of you know abstract factory pattern, in the prototype
pattern when you want to create a clone of an object of some
class, then instead of creating directly the clone that
means using new operator and step by step copying the
elements, or you will be calling the copy constructor of the
class.
But in the real time applications we dont want the copy
constructor to be called so it is made as private, and hence
you cannot copy the items, so this design patterns says that
if you want to create the clone of a class, keep the clone
fucntion as virtual in the base class and let the derived
class implement...this is one aspect.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What does no cap mean?
#include
What are oops methods?
Why do we need polymorphism in c#?
What is the important feature of inheritance?
What does I oop mean?
Why do we use oop?
What is the difference between a constructor and a destructor?
What is static modifier?
How do you explain polymorphism?
What is the importance of oop?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What is the main purpose of inheritance law?
What are objects in oop?
What is the oops and benefits of oops programming?