An example for this:
int sortObj(object obj1, object obj2)
{
return (int)obj1 == (int)obj2 ? 0 : (int)obj1 > (int)obj2 ? 1 : -1;
}
private void Form1_Load(object sender, EventArgs e)
{
int a=9, b=2, c=5, d=1;
object[] obj = new object[4]{a,b,c,d};
Array.Sort<object>(obj, new Comparison<object>(sortObj));
}