What is the na开发者_如何学编程me of the character at the end of each of these lines?
Dim _int As Integer = 1I
Dim _short As Short = 1S
Dim _long As Long = 1L
Dim _single As Single = 1.0F
Dim _double As Decimal = 1D
I've always called these "type specifiers". I assume that's incorrect as I'm unable to find the official documentation using this term. I would like to know what others are available but can't find the right term to use in my search.
It's called a type suffix.
According to the documentation in VB.NET they are called "literal type characters". See the section on "forced literal types".
According to MSDN in C# are called: Type suffix
精彩评论