what is the difference between dynamic and var


What is the difference between dynamic and var data types?

The difference among the var and dynamic data types is that the var data type is strongly type checked at the compile time; while, the dynamic data type is type checked by the compiler only at run time. After declaring a var data type, you cannot explicitly alter its type throughout the execution of the program; though, a variable of the dynamic data type can be changed during runtime. Another major difference among the two is that dynamic type can also be used as the return type for methods, for which var cannot be used.

 

Request for Solution File

Ask an Expert for Answer!!
DOT NET Programming: what is the difference between dynamic and var
Reference No:- TGS0311192

Expected delivery within 24 Hours