C
C#10mo ago
w11

var keyword

does using the var keyboard as opposed to specifying the data type to declare variables affect the performance of the app ?
4 Replies
Jimmacle
Jimmacle10mo ago
no, there is no difference a variable declared with var still has a specific type, it's just a shortcut to not have to write it out
w11
w11OP10mo ago
alr thanks
jcotton42
jcotton4210mo ago
specifically var is type inference, not dynamic typing or anything the following two lines are compiled to the same output
var i = 1;
int i = 1;
var i = 1;
int i = 1;
w11
w11OP10mo ago
thanks, that clears it up for me!

Did you find this page helpful?