C# SByte CompareTo(Object)
Description
SByte CompareTo(Object)
compares this instance to a
specified object and returns an indication of their relative values.
Syntax
SByte.CompareTo(Object)
has the following syntax.
public int CompareTo(
Object obj
)
Parameters
SByte.CompareTo(Object)
has the following parameters.
obj
- An object to compare, or null.
Returns
SByte.CompareTo(Object)
method returns A signed number indicating the relative values of this instance and obj.
Return Value Description Less than zero This instance is less than obj. Zero
This instance is equal to obj. Greater than zero This instance is greater
than obj. -or- obj is null.
Example
using System;// ww w . j a v a2 s . c om
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(sbyte.MinValue.CompareTo((object)sbyte.MaxValue));
}
}
The code above generates the following result.