Gyoei
✅ Difficulty understanding Inheritance and where to use Constructor
Hello people. I'm learning OOP and I've come across this problem. I'm creating a Football team creator console app. I have a abstract class called Player which has the base properties. I have four inherited classes (Defender, Midfielder, etc) which all have different skill properties(Passing, Shooting etc).
I have two Questions:
1. Where(in Player or in inherited classes) and how do I put the constructor so it inherits all the properties of Player.
2. I have a DisplayInfo() method in Player Class. I want to use this method in inhertied classes but add additional functionalities to display the skill properties.
Code:
1. Abstract Player Class
2. inherited Defender Class
4 replies