Should I use int or Int32

前端 未结 30 2451
野性不改
野性不改 2020-11-22 11:52

In C#, int and Int32 are the same thing, but I\'ve read a number of times that int is preferred over Int32 with no reason

30条回答
  •  無奈伤痛
    2020-11-22 12:52

    It makes no difference in practice and in time you will adopt your own convention. I tend to use the keyword when assigning a type, and the class version when using static methods and such:

    int total = Int32.Parse("1009");
    

提交回复
热议问题