1
Reply

What is Dynamic Binding ?

Munesh  Sharma

Munesh Sharma

Mar 28, 2011
6.2k
0

    Dynamic binding is a process to bind elements at runtime. It is also known as association of method at runtime not compile time. Dynamic binding in c# defers binding i.e. the process of resolving types, operators and members from compile time to runtime. We can use dynamic binding when we know that certain function, member or operation exists at compile time but the compiler does not know about its existence until that member is called at runtime. This process normally occurs when interrupting with dynamic languages or com or when we use concept of reflection in our program.   

    A dynamic type is declared by using keyword dynamic:

    dynamic obj = CallSomeMethod();
    obj.disp();

    A dynamic type informs the compiler to expects the runtime type of obj to disp() method.

    Visit

    kalit sikka
    June 20, 2011
    0