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



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

Post New Answer

More OOPS Interview Questions

#include <string.h> #include <stdio.h> #include <stdlib.h> #include<conio.h> void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

0 Answers  


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

0 Answers   Wipro,


What is a template?

7 Answers  


What is object in oop with example?

0 Answers  


what is meant by files?

4 Answers   Infosys,






What are the 4 pillars of oop?

0 Answers  


How Do you Code Composition and Aggregation in C++ ?

3 Answers   IBM, NET,


Why is abstraction used?

0 Answers  


What is ambiguity in c++

4 Answers   Accenture, Mphasis,


Program to read a comment string

1 Answers   IBM,


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

0 Answers  


What is pointer in oop?

0 Answers  


Categories