FAQs_OOPs
FAQs_OOPs
FAQs_OOPs
------------
OOPS Function Module
It is object-oriented. It is procedural oriented.
It uses objects and classes. It contains a block of code for a specific
functionality
It is a bottom-up approach. It is a top-down approach.
Inheritance is possible. Inheritance is not possible.
Polymorphism is possible. Polymorphism is not possible.
Have access specifiers:
Private, public, and Protected. Does not have any access specifier.
2. Types of classes?
- ABAP class, Abstract Class, Exception Class, Persistent Class, Final.
Abstract class?
- Abstract Class is a special kind of class which can�t be instantiated.
Abstract class should at least contain one abstract method.
Abstract methods are declared without any implementation.
These abstract methods are implemented in the derived classes (Sub-classes).
Class with at least one abstract method (which does have implementation) is
known as �Abstract class�.
Example: Let�s take a simple real time scenario, where �TELEPHONE� is your
class. This class is having four Methods (each method depicts one functionality):
1)PICKUP_CALL
2)DROP_CALL
3)REJECT_CALL
4)DIAL_NUMBER(the functionality of this method is same, that is dialing a
number. But the implementation could be different in different scenarios.)
--FINAL class?
- If a class is defined as FINAL class then there won't be any sub-class for that
class, in other words inheritance will not be possible for that class.
Class with at least one abstract method (which does have implementation) is
known as �Abstract class�.
Example: Let�s take a simple real time scenario, where �TELEPHONE� is your
class. This class is having four Methods (each method depicts one functionality):
1)PICKUP_CALL
2)DROP_CALL
3)REJECT_CALL
4)DIAL_NUMBER(the functionality of this method is same, that is dialing a
number. But the implementation could be different in different scenarios.)