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 |
Can private class be inherited?
What is abstraction in oop?
where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?
What is abstrac class?where is it use?
polymorphism means?
What is polymorphism and types?
What is polymorphism oop?
What is cohesion in oop?
How do you use inheritance in unity?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
How is data security provided in Object Oriented languages? ?
3. Differentiate verification and validation.