- 1

Can't use var as a acceptable answer?

asking to declare int and set 43, why can't we use var as a acceptable alternative solution?

18th Mar 2018, 6:10 AM
Jordan Bejar
Jordan Bejar - avatar
1 Antwort
+ 8
generally uses var only when it is required. An implicitly typed local variable is strongly typed just as if you had declared the type yourself, but the compiler determines the type. Local variables can be given an inferred "type" of var instead of an explicit type.
18th Mar 2018, 6:19 AM
Scooby
Scooby - avatar