var :
- it should be initialized
- We can not pass var in method as argument.
- Once the type is initialized it can not be changed. It become a strongly type.
- Var type is known at compile time. e.g var x = “strng1”; int len= x.Length, here compiler know that x is string type.
Object:
- It is not needed to initialize
- We can change and pass any type data in object.
- Type is resolved at run-time.
Dynamic:
- It is not needed to initialize.
- We can pass dynamic as argument in method.
- Has overhead on compiler for casting.
- Dynamic type is known at run time. e.g var x = “strng1”; int len= x.Length, here compiler uses reflection to know the type of x at run time and then check for length method in string.Dynamic internally uses reflection.