What is this called?
double d1 = 0d;
decimal d2 = 0L;
float d3 = 0f;
And where can I find a reference of characters I can use? If I want
This
double d1 = 0d;
is an example of a literal and the character after the digits is a suffix. There is not one for short
. You need to cast:
short s = (short)0;
These are defined in 2.4.4 of the language specification, specifically 2.4.4.2 will tell you about integer literals where you will see that there is no way to express a short
using a literal. Additionally, the integer-type-suffix
es are:
U u L l UL Ul uL ul LU Lu lU lu
which represent various signed/unsigned int/long types. Again, no way to express a short
using literal.