C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 16)
16.
Which of the following concepts means adding new components to a program as it runs?
Data hiding
Dynamic typing
Dynamic binding
Dynamic loading
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
23 comments Page 2 of 3.

Duude avinash(lpu) said:   1 decade ago
Provide separate programme on dynamic loading and dynamic binding.

Ashok said:   1 decade ago
class shape { public:
void draw();
};
class circle : public shape { };
int main(int argc, char **argv){
circle my_circle;
my_circle.draw();
}

While this has all the usual advantages, e.g., code reuse, the real power of polymorphism comes into play when draw is declared to be virtual or pure virtual, as follows:

class shape{ public:
virtual void draw()=0;
};
class circle : public shape { public:
void draw();
}

Here, circle has declared its own draw function, which can define behavior appropriate for a circle. Similarly, we could define other classes derived from shape, which provide their own versions of draw.

Now, because all the classes implement the shape interface, we can create collections of objects that can provide different behavior invoked in a consistent manner (calling the draw member function). An example of this is shown here.

shape *shape_list[3]; // the array that will
// pointer to our shape objects
shape[0] = new circle; // three types of shapes
shape[1] = new square; // we have defined
shape[2] = new triangle;
for(int i = 0; i < 3; i++){
shape_list[i].draw();
}

Suvarna said:   1 decade ago
Can anyone explain dynamic loading?

VINUTH said:   1 decade ago
Dynamic doesn't mean "multiple",

Dynamic means multiple so we want to insert any external components inside the program just we use this concept.

Diya said:   1 decade ago
Dynamic means "which keeps on changing".

The changes that are made to the class object when the program runs at run time or dynamic time when its values keeps on changing as per the user's input is called dynamic loading.

Maulana azad said:   1 decade ago
Loding means carrying heavy things. Binding means tying loded things.

Msiri kisenga said:   10 years ago
I think the answer should be the dynamic biding because the new component is added at run time.

Dynamic loading the new component will be added at compiler time.

RAJASEKHAR said:   10 years ago
Can anyone explain what is dynamic typing?

Tani said:   9 years ago
How this concept is valid in OOPs. Can anyone explain?

Sumit said:   9 years ago
What is an instance variable? Any can explain it.
(1)


Post your comments here:

Your comments will be displayed after verification.