Interfaces methods requirements in C#
Forums:
interface ICar {
bool StartEngine();
void StopEngine();
}
class SportCar: ICar {
private bool started;
public bool StartEngine() {
if (started)
return false;
started = true;
return true;
}
public void StopEngine() {
started = false;
}
}
- Log in to post comments