Hello all, The following question is from www.jchq.net Name three principal characteristics of Object Oriented programming? 1) encapsulation, dynamic binding, polymorphism 2) polymorphism, overloading, overriding 3) encapsulation, inheritance, dynamic binding 4) encapsulation, inheritance, polymorphism The answer is 4 I know 4 is a correct answer, but I don't understand why 3 is not correct. Late binding, dynamic binding and polymorphism are not the same ? Thanks in advance! Jack
Static binding means that the function being called is determined as the program is compiled Dynamic binding is the opposite of static binding. The binding decision is delayed until runtime. This allows you to add components to your program while it is still running. If the runtime environment is designed to support this (and Rhapsody should be), it opens up a lot of interesting possibilities.
The C++ language supports a limited version of dynamic binding called late binding. In C++, a function call must type-match exactly the called function (called static typing) or else type-match exactly an inherited function. Though C++ virtual functions allow you to delay the binding until runtime, the type constraints still apply. Late binding is still restricted. Dynamic binding is unconstrained.
I believe that polymorphism is a broader term, which groups the concepts of dynamic binding, static binding, super class variables to access sub class objects, overriding, dynamic method dispatch etc. And Ans C is correct because its Polymorphism that is one of the pillars of OOPs and not just dynamic binding. Comments are welcome.