What is common Type System (CTS)?

Experience Level: Senior
Tags: .NET

Answer

.NET uses Common Type System (CTS) for Language Interoperability.

CTS defines the predefined data types that are available in Intermediate Language (IL). Thanks to CTS all languages that target the .NET Framework can produce complied code that is using same set of defined types. During the compilation, all language specific data types are mapped to data types defined in CTS.

CTS ensures that a data type defined in a VB.NET will be understood by C#. For example, VB.NET uses integer to define the data type integer. C# uses int to define the data type Integer. When VB.NET code is complied , the Integer type is converted to Int32. Since C# refers int to Int32, VB.NET code will be understood by C#.

Comments

No Comments Yet.
Be the first to tell us what you think.