Tell me or correct me if I am wrong here. If you have an abstract class, base class of "Vehicle" with a method of:
public abstract void setMySpeed();
It is a fact that the setMySpeed() function will never, ever be fired off in the abstract class, instead the derived of classes of the Vehicle are going to be forced to implement this method. So the best way to do this is to right click the setMySpeed(); method function and say Refractor ---> Extract interface to create an interface class like:
Code:
Namespace OOpsPractice
{
interface ISpeed
{
void setMySpeed();
}
}
Which has the effect of creating a new class called ISpeed.cs.
The purpose of this interface class is help force implementation in the derived classes of the abstract class of Vehicle?
Is this correct?
Are not abstract classes in C# very similar to Absolute Virtual base classes in C++?