+ 2

How is int is a structure in c#?

5th Sep 2016, 3:15 AM
Samkitkumar Jain
Samkitkumar Jain - avatar
3 odpowiedzi
+ 1
When you want to make a new int variable, you simply declare it thru this: int num = value; And not thru this: int num = new int(value); That way of making an instance of an object is one of the characteristics of a structure, thus making the "int" a "struct"
7th Sep 2016, 4:39 PM
Erwin Mesias
Erwin Mesias - avatar
0
Int also have methods however because it is a struct you have no field variables and cannot inherit from it..
8th Sep 2016, 5:25 PM
Brandon McNearney
Brandon McNearney - avatar
- 4
int variable name;
5th Sep 2016, 4:21 AM
sachin