Common Type System (CTS) in .NET

 

The Common Type System (CTS) defines how the types has to be declared, used in different languages of .Net. The Common Language Runtime (CLR) of .Net supports all the types defined in Common Type System.

 

The Common Type System contains all types defined by every .Net language, that doesn't mean that every .Net language supports all types in CTS. For example integers are defined by using Integer keyword in Vb.Net whereas in C# integers are defined by using int keyword.

 

The Common Type System Supports two general categories. Those are Value Types and Reference Types in .Net

 

CTS Data Type

VB.NET Keyword

C# Keyword

C++/CLI Keyword

System.Byte

Byte

byte

unsigned char  

System.SByte

SByte

sbyte

signed char  

System.Int16

Short

short

short   

System.Int32

Integer

int

int or long 

System.Int64

Long

long

__int64   

System.UInt16

UShort

ushort

unsigned short  

System.UInt32

UInteger

uint

unsigned int or unsigned long

System.UInt64

ULong

ulong

unsigned __int64  

System.Single

Single

float

Float   

System.Double

Double

double

Double   

System.Object

Object

object

Object^   

System.Char

Char

char

wchar_t   

System.String

String

string

String^   

System.Decimal

Decimal

decimal

Decimal   

System.Boolean

Boolean

bool

Bool  

 

Value Types: Value types are store actual data not reference to data and value types are stored in Stack memory. Example of value types are integers, decimals, float, boolean...etc. Please find below table for how to represent value  types in different languages.

 

Reference Types: Reference types store reference to the data instead of actual data and stored in heap memory. Examples of Reference types are Class, interface,

Structure, Enumerations. All these are represented as almost same in all .Net languages.

 

For more information on Value Types and Reference Types Click here.