0

what is meant var??why use var??

8th Oct 2016, 12:41 PM
rakeshkumar
rakeshkumar - avatar
2 Answers
+ 3
var is an implicit data type. The compiler decides what type of data it holds. For example var x = 3.4; The compiler knows thats a double floating point number. For more info check microsoft c# reference page.
8th Oct 2016, 12:54 PM
Ousmane Diaw
+ 2
Because it is boring to write like this: List<string> mylist = new List<string>(); And with var: var mylist = new List<string>(); So var makes it not so boring.
8th Oct 2016, 9:14 PM
Ivan G
Ivan G - avatar