C# SByte CompareTo(SByte)
Description
SByte CompareTo(SByte)
compares this instance to a specified
8-bit signed integer and returns an indication of their relative values.
Syntax
SByte.CompareTo(SByte)
has the following syntax.
public int CompareTo(
sbyte value
)
Parameters
SByte.CompareTo(SByte)
has the following parameters.
value
- An 8-bit signed integer to compare.
Returns
SByte.CompareTo(SByte)
method returns A signed integer that indicates the relative order of this instance and value.
Return Value Description Less than zero This instance is less than value.
Zero This instance is equal to value. Greater than zero This instance is greater
than value.
Example
using System;/*from w w w.ja va 2 s . c om*/
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(sbyte.MinValue.CompareTo(sbyte.MaxValue));
}
}
The code above generates the following result.