4. What do you mean by a prototype? Define analysis
prototype
Answer / 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 |
What is abstraction example?
Can we have a private constructor ?
12 Answers HSBC, Ness Technologies, TCS, Wipro,
What does the keyword "static" mean?
What is destructor example?
How to overload postfix operator in c++
what is the difference between function template and template of function?explain with example.
which is platform independent device used in computers
What is a scope resolution operator?
write a program that takes input in digits and display the result in words from 1 to 1000
what is the difference between virtual function and destoctor?
What is interface? When and where is it used?
What are different oops concepts?