why we did not declare Int32 in C#?
As we know c# datatypes are object by inheriting the CTS classes.
When we declare
int anyVariable=anyValue;
Exactly what we are doing .?
If we are creating an instance object of type int or what?
Please give me some detail idea....
Thanks in advance...
Ashok
An Int32 inherits from System.ValueType which in turn inherits from System.Object.
Anything that inherits from ValueType (ie Int32, DateTime and any other structure) are actually created on the stack, whereas reference types, such as those that inherit directly from System.Object are created on the managed heap. Because of that, Value Types are typically less expensive to 'create' than reference types.
When you use the default constructor of a structure (ie Int32 myInt = new Int32()), you are essentially just zeroing out all of its fields.