You may have seen Java, where int and Integer are two different things, and for the latter you need to write new Integer(10) .
C # int has a special alias for Int32 , and they are the same for all purposes and tasks. Indeed, to create a new instance of any type, you need to write new Int32() or something else.
However, since integers are primitive types in C # (and most programming languages), there is a special syntax for integer literals. Just writing 10 makes it Int32 (or int ).
In your example, you actually assign the value of the variable a twice:
int a = new Int32();
It can be assumed that since the second assignment overwrites the first, the first assignment is not required.
source share