OOPS Questions ND Answers
OOPS Questions ND Answers
Ans:
Object orientation (OO), or to be more precise, object-oriented programming,
is a problem-solving method in which the software solution reflects objects in
the real world.
A comprehensive introduction to object orientation as a whole would go far
beyond the limits of this introduction to ABAP Objects. This documentation
introduces a selection of terms that are used universally in object orientation
and also occur in ABAP Objects. In subsequent sections, it goes on to discuss
in more detail how these terms are used in ABAP Objects. The end of this
section contains a list of further reading, with a selection of titles about object
orientation.
Method Overriding
Method Overloading
Operator Overloading
We can create four types of classes under final and only modeled
category(optional) with the private, protected, public and abstract instantiation.
Usual Abap Class.
Exception Class(With/Without messages).
Persistent Class.
Test Class(ABAP Unit).
We can create four types of classes under final and only modeled
category(optional) with the private, protected, public and abstract instantiation.
Usual Abap Class.
Exception Class(With/Without messages).
Persistent Class.
Test Class(ABAP Unit).
Abstract method
Abstract instance methods are used to specify particular interfaces for
subclasses, without having to immediately provide implementation for them.
Abstract methods need to be redefined and thereby implemented in the
subclass (here you also need to include the corresponding redefinition
statement in the DEFINITION part of the subclass). Classes with at least one
abstract method are themselves abstract. Static methods and constructors
cannot be abstract (they cannot be redefined).
Abstract (instance) methods are defined in the class, but not implemented
They must be redefined in subclasses.
Global
Local Exceptions Class.
Define an event
Define a method
Link event and method and convert the method into event-handler method
Create a triggering method which will raise the event
Use set handler and register event handler method to a particular instance in
the program
Local classes are defined locally with in a program and the other programs
can’t access the same classes directly.
But global classes are not like that they are globally accessible from ABAP
environment.
Global classes are centrally defined in a repository. Transaction code for
global classes is SE24(class builder).
Public class
Private class
Final class
Singleton class
Abstract class
Persistent class
Friend class