Help:how to implement Icomparable uisng generics
this is a small portion from my code
public class Rational:IComparable<Rational>
{
// instance variables
private int numerator;
private int denominator;
.
.
.
// interface method with generics
public int CompareTo(Rational otherRational)
{
if (Rational < otherRational)
return -1;
else
if (Rational == otherRational)
return 0;
else
return 1;
}
i have this error message:Rational' is a 'type' but is used like a 'variable'
i need help!