Your interface should be
interface IBankAccount<T> : IComparable<IBankAccount<T>>
{ }
abstract class BankAccount<T> : IBankAccount<T>
{
public int Compare(IBankAccount<T> other)
{
return Balance.CompareTo(other.Balance);
}
}
But, I'm not sure you need a generic here. Inheritance is sufficient.