A)
->super class method provided functionality is either insufficient or not at all required for the subclass object. Sub class object wants have only method name reusability but not the method code(body) reusability. Option is , go for method overriding.
Note:
When method overriding is implemented and if the method is called on the subclass object, always sub class method only will be called but not the overridden method.
Additional information:
->the sub class object should contain both its own classes and its parent class method when object is created.
->if the parent method have protected mode the child class method should have protected or public mode only but not should contain private and default mode.
Comments
Post a Comment