C# Convert ToInt16(Byte)
Description
Convert ToInt16(Byte)
converts the value of the specified
8-bit unsigned integer to the equivalent 16-bit signed integer.
Syntax
Convert.ToInt16(Byte)
has the following syntax.
public static short ToInt16(
byte value
)
Parameters
Convert.ToInt16(Byte)
has the following parameters.
value
- The 8-bit unsigned integer to convert.
Returns
Convert.ToInt16(Byte)
method returns A 16-bit signed integer that is equivalent to value.
Example
//from w w w . j av a 2s. c o m
using System;
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Convert.ToInt16((Byte)12));
}
}
The code above generates the following result.