type inference var
c#, types, var, variant
Solution
`var` does not degrade performance at all. The variable is still strongly typed:
An implicitly typed local variable is strongly typed just as if you had declared the type yourself, but the compiler determines the type.
The only difference is that you don't have to manually spell out the type in source code. There's no relation at all with VB 6's `Variant`, if that's what you are referring to.
Problem
Type inference makes use of the `var` keyword. The compiler "infers" what the type of the variable is by what the variable is initialized to. e.g. var somenum=o; becomes int somenum=0; Even though somenum is never declared as being an `int`, the compiler figures this out & somenum is an `int` for as long as it is in scope. it is like `variant` type used in `visual basic`. using it in program, upto some extent it degrades performance & `var` is not included in dot net framework before 3.5 . even it degrades performance & dot net framework supports strong type checking ,why `var` is included in framework 3.5? is `var` violets strong type checking? if not how?