Home Interview Questions and AnswersTechnical Interview Questions and Answers.NET .Net Dynamic Programming Interview Questions and Answers for Freshers and Experience Part-2

dynamic-languages-for-net-clr-1-7287. What is the difference between dynamic and var data types?

The difference between the var and dynamic data types is that the var data type is strongly type checked at the compile time; whereas, the dynamic data type is type checked by the compiler only at run time. After declaring a var data type, you cannot explicitly change its type throughout the execution of the program; however, a variable of the dynamic data type can be changed during runtime. Another major difference between the two is that dynamic type can also be used as the return type for methods, for which var cannot be used.
8. Which class is used for converting the data types?

The System.Convert class provides a complete set of methods for converting the data types.

You may also like

Leave a Comment