InterviewSolution
Saved Bookmarks
| 1. |
Are Constructors Inherited? Can A Subclass Call The Parent’s Class Constructor? |
|
Answer» We cannot inherit a CONSTRUCTOR. We create an instance of a subclass using a constructor of one of its superclass. Because OVERRIDE the superclass constructor is not our wish so that, we override a superclass constructor, then we destroy the ENCAPSULATION abilities of the LANGUAGE. We cannot inherit a constructor. We create an instance of a subclass using a constructor of one of its superclass. Because override the superclass constructor is not our wish so that, we override a superclass constructor, then we destroy the encapsulation abilities of the language. |
|