Adherence to the CTS enables all .NET languages to interoperate . Having a common type system enables codes from different languages to integrate seamlessly. You can easily pass a variable of a common type between methods written in different .NET languages. You can even write a class in C# which inherits from a class written in VB .NET. One factor that makes such interoperability possible is the adherence of each .NET programming language to the CTS. The CTS specifies a set of common types shared by all the .NET programming languages. You can either use the full .NET framework type name or the C# alias [9] in your C# programs. Table 9.6 shows the available C# aliases for types defined in the CTS.
This implies that the following two statements are equivalent, except that the first is easier to read: ulong temp = 99L; // usage of C# alias System.UInt64 temp = 99L; // usage of full type name Other .NET languages may have their own aliases for the .NET types too, so that writing in those languages will be more natural. For example, for VB .NET developers, their familiar Integer type maps to System.Int32 . And for J# developers, J#'s int type also maps to System.Int32 . VB .NET's Integer type and J#'s int type refer to exactly the same type as C#'s int “ a 32-bit signed integer. Additional notes:
|