what is oppes
Answers were Sorted based on User's Feedback
Answer / aayush patwa
A type of programming in which programmers define not only
the data type of a data structure, but also the types of
operations (functions) that can be applied to the data
structure. In this way, the data structure becomes an
object that includes both data and functions. In addition,
programmers can create relationships between one object and
another. For example, objects can inherit characteristics
from other objects.
One of the principal advantages of object-oriented
programming techniques over procedural programming
techniques is that they enable programmers to create
modules that do not need to be changed when a new type of
object is added. A programmer can simply create a new
object that inherits many of its features from existing
objects. This makes object-oriented programs easier to
modify.
To perform object-oriented programming, one needs an object-
oriented programming language (OOPL). Java, C++ and
Smalltalk are three of the more popular languages, and
there are also object-oriented versions of Pascal.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is difference between new and malloc?
What is the difference between declaration and definition?
Why do we need polymorphism in c#?
What is the example of polymorphism?
namespace is working on which compiler?
what is new operator in c++
can you give the dynamic polymorphism types?
The type of variable a pointer points to must be the part of pointer's definition so that:
Why it is called runtime polymorphism?
swapping program does not use third variable
Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation
What is polymorphism programming?