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
and
Both reference and value types are derived from the ultimate base class Object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With