freshers/Experienced Dotnet jobs

20/09/2011

Difference between Dynamic polymorphism and static polymorphism

In static polymorphism response to a function is decided at compile time. In Dynamic polymorphism response to a function is decided at run time. 1)Static polymorphism is achieved by method overloading where as run time polymorphism( or dynamic polymorphism) is achieved by method overriding. 2)static polymorphism uses the concept of compile time binding(or early binding) where as dynamic polymorphism uses the concept of runtime binding (or late binding). 3)Dynamic polymorphism is faster than static polymorphism. 4)To implement static polymorphism inheritance is not necessary where as to implement dynamic polymorphism inheritance is necessary. 5)Generally when a programmer want to extend existing feature in a software,method overloading(load + extra load(more lines of code)) is used,and a programmer uses method overriding when he wants to provide a different implementation for the sa

No comments:

Post a Comment