Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between keywords ‘var’ and ‘dynamic’ ?

user-image
Question added by Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
Date Posted: 2016/10/19
Nouran Adel
by Nouran Adel , IT Engineer , Export Development Authority

   var in .NET 3.5

dynamic in .NET 4

Khuram Nawaz Khayam
by Khuram Nawaz Khayam , Software Desing and Development Engineer , Fiverr

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.

محمد جمال
by محمد جمال , Senior .Net C# Web Developer , JIC

var: All the methods, property or any other information are available at compile time and dynamic in run time only

mohamed mursheed
by mohamed mursheed , It Coordinator , Tylos Plastic Industries Bahrain

Variables declared with var are implicitly but statically typed. Variables declared withdynamic are dynamically typed. ... When using the 'varkeyword, the type is decided by the compiler at compile time, whereas when using the 'dynamic'keyword, the type is decided by the runtime

Umair Khan
by Umair Khan , Web Developer , Innovative Designers

In var type compiler will specify its type at compile time. and dynamic type checks will be performed during runtime not by the compiler.

More Questions Like This