Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding objects

Former Member
0 Likes
398

Why we go for redifintion in subclasses and when we go

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
377

Hi,

Rediefination is when we the Implememtation of an inherited instance method is changed for the subclass ,without Changing the signature.At the same time the visibility section for the superclass must remain the same. ( therfore REDIFINITION is not possible within PRIVATE SECTION).

When you use REDEFINITION addition you must specify a (new) Implememntation part for the inherited method.As the signature may not be changed , you do not need to define the method parameters and exceptions again.

Regards,

Sathishkumar.V

2 REPLIES 2
Read only

Former Member
0 Likes
378

Hi,

Rediefination is when we the Implememtation of an inherited instance method is changed for the subclass ,without Changing the signature.At the same time the visibility section for the superclass must remain the same. ( therfore REDIFINITION is not possible within PRIVATE SECTION).

When you use REDEFINITION addition you must specify a (new) Implememntation part for the inherited method.As the signature may not be changed , you do not need to define the method parameters and exceptions again.

Regards,

Sathishkumar.V

Read only

Kanagaraja_L
Active Contributor
0 Likes
377

Abstract methods need to be redefined and thereby implemented in the subclass and then you need to include the corresponding redefinition statement in the DEFINITION part of the subclass.

Abstract class has at least one method that doesn't have an implementation. But may have several methods.

Kanagaraja L