Skip to content

Instantly share code, notes, and snippets.

@sasan-salem
Created April 1, 2021 08:01
Show Gist options
  • Save sasan-salem/012406573fd6d86711244b4efedd0534 to your computer and use it in GitHub Desktop.
Save sasan-salem/012406573fd6d86711244b4efedd0534 to your computer and use it in GitHub Desktop.
class Student : IComparable<Student>
{
public string Name { get; set; }
public int Number { get; set; }
public int SerialNo { get; set; }
public int Grade { get; set; }
public int CompareTo(Student other)
{
if (other.SerialNo < SerialNo)
return 1;
else if (other.SerialNo == SerialNo)
return 0;
else
return -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment