I really confused about usage var
keyword in C#
.
I know, that var
make code more easier to read, but what about speed and memory?
A.
var a = 100;
int b = 100;
int c; c = 100;
B.
var listA = new List<obj>();
List<obj>listB = new List<obj>();
List<obj>listC; listC = new List<obj>();
Which faster?
There is a dependence on the type?
How much memory is allocated in both situation and when that memory allocated?