A run-time error occurs when Array.Sort is called: XClass does not implement the IComparable interface.
using System; public class Starter { public static void Main() { XClass[] objs ={new XClass(5), new XClass(10), new XClass(1)}; Array.Sort(objs); } } public class XClass { public XClass(int data) { propNumber = data; } private int propNumber; public int Number { get { return propNumber; } } }