‎2007 Aug 15 5:42 PM
what is casting abstract class & final method in ABAP Objects give some scenario where actually use these.
‎2007 Aug 16 4:53 AM
HI
Abstract Class is used for just declaration purposes. Its methods must be implemented in the class which implements it.
Final method is one whose definition cant be over-ridden.
For ex.. You may declare a shape class as abstract. It may contain a number of methods like color, size, etc.. but its methods are implemented in the classes that implement it like rectangle, square etc...
regards
Swati
‎2007 Aug 16 12:19 AM
Hi Suri,
casting essentially means that the memory area can be handled assuming a particular type. This is enabled by field symbols.
Abstract classes cannot be instantiated. You use abstract classes as templates for subclasses. In other words abstract classes can only be used in subclasses.
Final classes cannot be inherited. In other words you cannot create subclasses.
Cheers
Graham
‎2007 Aug 16 4:53 AM
HI
Abstract Class is used for just declaration purposes. Its methods must be implemented in the class which implements it.
Final method is one whose definition cant be over-ridden.
For ex.. You may declare a shape class as abstract. It may contain a number of methods like color, size, etc.. but its methods are implemented in the classes that implement it like rectangle, square etc...
regards
Swati
‎2007 Aug 16 6:00 AM
‎2007 Aug 16 6:14 AM
Hi Sri,
I'm not sure we can be any more clear.
An Abstract class can not be instantiated. It can only be used as the superclass for it's subclasses. In other words it <b>can only be inherited</b>.
A Final class cannot be the superclass for a subclass. In other words <b>it cannot be inherited.</b>
I recommend the book <a href="http://www.sappress.com/product.cfm?account=&product=H1934">ABAP Objects: ABAP Programming in SAP NetWeaver</a>
Cheers
Graham