C# Convert ToInt16(Object)
Description
Convert ToInt16(Object)
converts the value of the specified
object to a 16-bit signed integer.
Syntax
Convert.ToInt16(Object)
has the following syntax.
public static short ToInt16(
Object value
)
Parameters
Convert.ToInt16(Object)
has the following parameters.
value
- An object that implements the IConvertible interface, or null.
Returns
Convert.ToInt16(Object)
method returns A 16-bit signed integer that is equivalent to value, or zero if value is null.
Example
/*from w w w. jav a 2 s . c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToInt16((Object)123));
}
}
The code above generates the following result.