Using the dynamic keyword vs the var keyword can be confusing. In this post I am going to explain the differences between dynamic and var keywords.
dynamic – is just an object which does not require any initialization
var – is a datatype that is inferred during compile time, which means you cannot create a variable without assigning an initial value.
A dynamic object can change type after being assigned but var cannot change type after assigned.
A dynamic object can be used as a return value for a function but var cannot be used to return value in a function
I hope you had found this post useful. Please do post your comments.