This is my first question here, so when i do something wrong, pls be so kind and just say it. So. I have found this in a textbook. Its the Class of an Object Array Sort programm. It's exact the thing i need but it's really poorly explained in the book and i can't get clever out of it. So could someone maybe explain it detailed for me?This would really help me.
class Person : IComparable
{
private string name;
public Person()
{
name = "EMPTY";
}
public Person (string nm)
{
name = nm;
}
public string NAME
{
get
{
return name;
}
}
public int CompareTo( object oneObject)
{
Person comparePerson = (Person)oneObject;
return (name.CompareTo(comparePerson.name));
}
public override string ToString()
{
return "Name of the Person: " + name;
}}