Translate

Monday, September 30, 2013

C# Primitive Type Definition



Predefined types (also called built in types) are types specially supported by the C# compiler.

For example int is a predefined tpe. (Note there are other types such as DateTime which are defined in the System Namespace but are not predefined by the C# compiler)



Primitive types are types that are directly supported by the CLR. All the value types excluding decimal are primitive types. You can determine whether a type is primitive using type.isPrimitive

For example

Console.WriteLine(typeof(int).IsPrimitive);//True
Console.WriteLine(typeof(string).IsPrimitive);//False


No comments:

Post a Comment

Comments will appear once they have been approved by the moderator