Is int (aka Int32
) an object , or a primitive in .NET (I'm not asking regarding int?
)?
I hit F12 on the saved word int
and got :
public struct Int32 : IComparable, IFormattable, IConvertible, IComparable<int>, IEquatable<int>
{ ... }
It doesn't inherit from Object , does it mean that int
is a primitive ?
Everything in C# inherits from object
, including int
.
From msdn:
Int32 is an immutable value type that represents signed integers
Both reference and value types are derived from the ultimate base class Object.