System Int16 is a C# data type that represents a 16-bit signed integer. It has a range from -32,768 to 32,767. It is mostly used in scenarios where memory usage is a concern, and a smaller data type is sufficient for the specific use case.
Here are some code examples:
// Declaring a variable of type Int16 and assigning a value to it Int16 myValue = 123;
// Casting an Int32 to an Int16 Int32 anotherValue = 321; myValue = (Int16)anotherValue;
// Converting a string to an Int16 string strValue = "456"; myValue = Int16.Parse(strValue);
The System Int16 data type is part of the System namespace library, which is included in the .NET Framework.
C# (CSharp) System Int16 - 60 examples found. These are the top rated real world C# (CSharp) examples of System.Int16 extracted from open source projects. You can rate examples to help us improve the quality of examples.