T
Tony Johansson
Hello!
Assume I have this IComparable interface and
I implement this IComparable in my class called MyTop see below.
If I now inherit a new class called MySub from MyTop this new class
is not obliged to implement this IComparable interface isn't that strange.
Wouldn't it be more correct to let the inherit class in this case mySub to
be obliged to implement the IComparable
interface.
I'm I totaly wrong here??
I have made a test this MySub just inherit this CompareTo method.
public interface IComparable
{
int CompareTo(IComparable comp);
}
class MyTop : IComparable
{
//Here I implement the CompareTo method
}
class MySub : MyTop
{
....
}
//Tony
Assume I have this IComparable interface and
I implement this IComparable in my class called MyTop see below.
If I now inherit a new class called MySub from MyTop this new class
is not obliged to implement this IComparable interface isn't that strange.
Wouldn't it be more correct to let the inherit class in this case mySub to
be obliged to implement the IComparable
interface.
I'm I totaly wrong here??
I have made a test this MySub just inherit this CompareTo method.
public interface IComparable
{
int CompareTo(IComparable comp);
}
class MyTop : IComparable
{
//Here I implement the CompareTo method
}
class MySub : MyTop
{
....
}
//Tony