I have already created a class and a subclass and have a bunch of code in both. I've created an interface in the parent class and I have no idea how to make my child class implement the interface :/
The code is:
class Car {
public interface ISmth
{
void MyMethod();
}
}
class MyCar : Car {
//implement the interface
}
This is how your code should probably be laid out.
There doesn't seem to be a reason to nest
ISmth
inCar
, but if you do have one you certainly could do it.You need to declare MyCar like that: