Shorthand syntax for common interfaces in C #

T?is a shorthand for Nullable<T>For example: int?is a shorthand for Nullable<int> Is shorthand syntax part of the language specification?

Is it allowed to create my own shorthand syntax for common interfaces?

+3
source share
2 answers

Yes, it ?is part of the specification. You cannot create your own shortcuts.

4.1.10 Impossible Types

null. T?, T . System.Nullable<T>, .

+6

Nullable # ( 1.3). - .

. N T nullable type T?, null. , int? , 32- .

+1

All Articles