Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

4. What do you mean by a prototype? Define analysis

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

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

More OOPS Interview Questions

We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?

8 Answers   IBM, Sage, Vertex,

how can we design a magic square in c++?or suggest me the basic idea of it.

3 Answers  

Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

0 Answers  

what is virtual destructor

7 Answers   L&T, TCS,

what is the main difference between c and c++?

386 Answers   AZTEC, B.Tech, CMC, College School Exams Tests, HCL, IBM, ITM, Khalsa Institute, Microsoft, Oracle, Sanjeevni Institute, TCS, Tech Mahindra, Wipro, ZeOmega,

write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.

4 Answers  

Why is it so that we can have virtual constructors but we cannot have virtual destructors?

2 Answers  

Can private class be inherited?

0 Answers  

What is an orthogonal base class?

2 Answers  

What are the different forms of polymorphism??

8 Answers   Mantaq, NUC, PCS,

Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?

5 Answers  

what is the new version of oops

0 Answers   Ignou,