12-23-2007 9:11 AM
12-23-2007 12:46 PM
12-23-2007 1:30 PM
12-24-2007 5:27 AM
12-26-2007 11:33 AM
Hi,
Inheritence should be used when dealing with related objects of the same category...for e.g. it makes sense for a class of 'Cars' to inherit from a class named 'Vehicle' becuase a car is a type of vehicle. As the word 'inherit' mean"to receive as if by succession from predecessors", so when you make a class inherit its parent class (or its SuperClass) it receives, in this case, all the properties (Methods/Events) and Attributes (Public and Protected data, constants etc.) of its superclass and the class itself is then known as a SubClass...so in short, Class "Vehicle" can be a superclass of the Class "Car" if car inherits vehicle (makes sense to do so).
See example of inheritance below from the book "ABAP Objects" by Horst Keller. I recommend you create this program in your system and run it in debugging mode to understand the concept of inheritance. Note - class "object" is the parent or root Class of all classes, that is to say all classes automatically inherit 'object' class therefore the statement
CLASS vehicle DEFINITION INHERITING FROM object.
Kindly Award Points If You Find The Reply Helpful.
Cheers,
Chaitanya.
12-26-2007 12:17 PM
Chaitanya, you do realise that what you've posted is word for word identical to that already posted in this very thread by Naresh, who copied it without acknowledgement from Sougata Chatterjee
matt
12-26-2007 6:27 PM
I think this situation is becoming so routine that it no longer surprises me more:
- User_1 forgets search for the 9 questions cited by other users and creates the tenth topic with the same title 'inheritance';
- User_2 Thinking only in get points he performs a search that User_1 forgotten to make and copies of the 9 answers found.
- User_3 The user who kindly devoted part of his time to answer one of 9 topics without forgetting the magic phrase '[Don't forget to reward points and good luck with ABAP Objects.|;' calls for his copyrights.
- User_4 To raise no suspicions copies only part of the response of user_2, perhaps because he think the One Million Members of the SDN are donkeys and will not understand what is happening !
Perhaps these rules are not clear to everyone then I suggest to some that accompany these types of topics and understand once and for all that 'WE ARE MINDFUL FOR THIS TYPE OF DISHONESTY '
- [User is flooding forum with irrelevent questions|;
- Sachdev Soman, DON'T OPEN DUPLICATED THREAD, close all your thread ( You have 4 open thread ) and reward point only for correct answer !
- Naresh and Chaitanya Raju, If you do not know the correct answer did not reply ! Do as the good users, just watch to learn ! And never use phrases like "Kindly Award Points If You Find The Reply Helpful." or "Reward if usefull" or "Don't forget to reward points and good luck with ABAP Objects.".
I hope that some people have learned !
Marcelo Ramos