C# FAQ: What is a type alias
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:FAQs |
| edit |
[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
|
[edit]
See also
- How use an alias for a class or namespace?
- Value types
- ECMA-334: 16.3 Extern alias directives
- ECMA-334: 16.4 Using directives
- ECMA-334: 16.7 Qualified alias member