أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
var in .NET 3.5
dynamic in .NET 4
var is a keyword that lets the compiler to choose correct type prior to starting the debugging. while dynamic is a static type keyword that chooses the type runtime.
var: All the methods, property or any other information are available at compile time and dynamic in run time only
Variables declared with var are implicitly but statically typed. Variables declared withdynamic are dynamically typed. ... When using the 'var' keyword, the type is decided by the compiler at compile time, whereas when using the 'dynamic'keyword, the type is decided by the runtime
In var type compiler will specify its type at compile time. and dynamic type checks will be performed during runtime not by the compiler.