Value type - short int long signed 16 bit 32 bit 64 bit integers
suggest change// assigning a signed short to its minimum value
short s = -32768;
// assigning a signed short to its maximum value
short s = 32767;
// assigning a signed int to its minimum value
int i = -2147483648;
// assigning a signed int to its maximum value
int i = 2147483647;
// assigning a signed long to its minimum value (note the long postfix)
long l = -9223372036854775808L;
// assigning a signed long to its maximum value (note the long postfix)
long l = 9223372036854775807L;
It is also possible to make these types nullable, meaning that additionally to the usual values, null can be assigned, too. If a variable of a nullable type is not initialized, it will be null instead of 0. Nullable types are marked by adding a question mark (?) after the type.
int a; // This is now 0.
int? b; // This is now null.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents