What is the difference between containment and delegation?
Answer / Awadhesh Prasad Gaur
Containment is a relationship in which one object has a pointer or reference to another object, allowing the containing object to access and manipulate the contained object. Delegation, on the other hand, is a design pattern in which an object defers some of its responsibilities to another object, usually by forwarding method calls to that object. In containment, the contained object is part of the containing object's lifetime; in delegation, the delegate object is independent.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a constant reference?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What is operators in c++?
Does c++ have finally?
Write a program that will count the number of digits in an input integer up to value MAX_VALUE (2147483647). Thus, for an input of 5837 the output should be 4 digits Make sure that your program works for the numbers 0, 1, and 10. For the number 0, the output should be 1 digit
Write a c++ code that will calculate the roots of a quadratic equation a2+ bx+c=0 Hint: d = sqrt (b2-4ac), and the roots are: x1 = (€“b + d)/2a and x2 = (€“b €“ d)/2a (use sqrt function from cmath.h )?
What are the types of container classes?
What is problem with Runtime type identification?
Write a program which uses functions like strcmp(), strcpy()? etc
What is polymorphism in c++? Explain with an example?
Is c++ the best programming language?
What is a unnitialised pointer?