Why are Instance variables of a superclass not overidden in Inheritance ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because inheritance is intended to modify behaviour. Behaviour is exposed through methods, and that’s why they can be overridden.
Fields are not behaviour but state. You don’t need to modify that, nor the private methods employed by the superclass. They are intended to allow the superclass to do it’s job.