Is int (Int32) considered an object in .NET or a primitive (not int?)?

前端 未结 6 1836
小蘑菇
小蘑菇 2020-12-31 20:19

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 g

6条回答
  •  盖世英雄少女心
    2020-12-31 20:41

    Referring to this MSDN site there are 15 build in types, from which 2 are classes (object and string) and the rest are primitives:

    bool - System.Boolean
    byte - System.Byte
    sbyte - System.SByte
    char - System.Char
    decimal - System.Decimal
    double - System.Double
    float - System.Single
    int - System.Int32
    uint - System.UInt32
    long - System.Int64
    ulong - System.UInt64
    object - System.Object
    short - System.Int16
    ushort - System.UInt16
    string - System.String
    

提交回复
热议问题