Can someone compare the dynamic binding of C++ and Java?
|
Can someone compare the dynamic binding of C++ and Java?
hi soccer022483,
Dynamic Binding is a programming concept it's alike in all programming languages meaning that it arranges for the decision to be deferred until the program is running .For example in C++ if you know virtual function and polymorphism ..if there's a base class with a virtual function draw() and there are derived classes that inherit this method draw().In the void main if there are 2 ptrs one pointing on the base class and the other pointing on the derived class and then we try to access the draw() method in each class the compiler won't diffrentiate at compile time which method to call the one in the base class or the derived class it saves this decision until runtime when it knows what class is pointed to by the ptr... you can implement the same concept with Java but I think with diffrent syntax .The concept is the same whatever programming language you use soccer .I hope this helps.
Sara,
« install worries | Imported Entities » |