What is difference between static and dynamic variables in C#? [closed]
Could you some one explain me detailed difference between static type and dynamic variables in C#?
static i mean is (static type) general variable. And also how dymanic variable is different from var and object?
In this video talk, Anders Hejlsberg, does a great job in explaining what the dynamic
variables are in the new C# 4.0.
http://channel9.msdn.com/Blogs/matthijs/C-40-and-beyond-by-Anders-Hejlsberg
Dynamic variables are seen as type Object
in your source code and any members that you access from them are bound at run time. Static variables have their types known at compile-time, and hence member accesses are directly placed into the assembly at compile-time.
A dynamic variable is a variable whose address is determined when the program is run.A static variable has memory reserved for it at compilation time.
In terms of ASP.Net the Static variable is equalent to the Application variable.
The type of a dynamic
variable is resolved at run-time.
精彩评论