Are there differences in the performance of variables implicitly and explicitly stated?

Asked

Viewed 35 times

1

There are differences in performance of explicitly declared variables?

List<int> lista = new List<int>();

And implicitly stated?

var lista = new List<int>();
  • Related: http://answall.com/questions/47383/quando-usar-var-em-c, although there is much controversy on the subject, and I prefer explicitly ...

  • Don’t get me wrong @viniciusbrasil on the duplicate, although I might even let others have a say.

  • 1

    There is no gain or loss of performance in using the var because the types of variables declared by var are defined at runtime, i.e. var v = 10; is the same as int v = 10; and the Assembly code will be the same.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.