Created
April 1, 2021 08:01
-
-
Save sasan-salem/012406573fd6d86711244b4efedd0534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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