In this chapter, we will get to see inheritance in action. In fact, we have already seen it, but now we will examine it more closely, discuss the benefits, and write classes that we can inherit from. Throughout the chapter, I will show you several practical examples of inheritance, and at the end of the chapter we will improve our naval battle simulation from the previous chapter and show how we could have saved lots of typing and future debugging by using inheritance.
We will cover the following topics in this chapter:
To get started, let's talk a little more about the theory.