C# FAQ: What is a type alias

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:FAQs
edit

What is a type alias?

C# defines a number of aliases for intrinsic Common Language Runtime (CLR) types. Aliases and types can be used interchangably. They can be mixed together in a single statement. For example:

string result = new System.String ('*', 10);

The following are the aliases defined in the CLR:

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

See also



Personal tools