Built-in types (C# reference)
The following table lists the C# built-in value types:
The following table lists the C# built-in reference types:
C# type keyword | .NET type |
---|---|
object |
System.Object |
string |
System.String |
dynamic |
System.Object |
In the preceding tables, each C# type keyword from the left column (except dynamic) is an alias for the corresponding .NET type. They are interchangeable. For example, the following declarations declare variables of the same type:
int a = 123;
System.Int32 b = 123;
The void
keyword represents the absence of a type. You use it as the return type of a method that doesn't return a value.
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for