- If you haven't already done so in the previous recipe, create an abstract class called Cat:
public abstract class Cat { public abstract void Eat(); public abstract void Hunt(); public abstract void Sleep(); }
- Next, add a class called Cheetah that inherits from the Cat abstract class:
public class Cheetah : Cat { }
- As soon as you inherit from the Cat abstract class, Visual Studio will show you a warning via the lightbulb feature. As you inherited from the abstract class Cat, you have to implement the abstract members within the abstract class in your derived class Cheetah:
- This is easily fixable by typing ...