blog

Home / DeveloperSection / Blogs / Dynamic Binding in C#.

Dynamic Binding in C#.

Anonymous User3941 28-Apr-2011

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.


Updated 18-Sep-2014
I am a content writter !

Leave Comment

Comments

Liked By