OO ABAP Interview Questions
OO ABAP Interview Questions
1|Page
No, you can not raise events in interface, Because there is no Implementation for the methods.
We can create events in interfaces .
11.What Is The Difference In Attributes Defined In The Public Versus Private Section Of A
Class?
Public attributes can be accessed by class, subclasses and other classes where as Private
attributes can be accessed by class itself only.
1. Method Overriding
2. Method Overloading
3. Operator Overloading
14.What is Inheritance ?
In OOPs terminology, inheritance is a way to form new classes using classes that have already
been defined. Inheritance is intended to help reuse existing code with little or no modification.
The new classes, known as derived classes, inherit attributes and behavior of the pre-existing
classes, which are referred to as base classes.
17.What is Aggregation ?
Aggregation is a special form of association. Aggregation is the composition of an object out of
a set of parts. For example, a car is an aggregation of engine, tyres, brakes, etc.
Aggregation represents a “Has” relationship like a car has a engine.
2|Page
18.What is object oriented programming language ?
Object oriented programming language allows concepts such as abstraction, modularity,
encapsulation, polymorphism and inheritance. Simula is the first object oriented language.
Objects are said to be the most important part of object oriented language. Concept revolves
around making simulation programs around an object.
20.Definition: Polymorphism
In object-oriented programming, polymorphism (from the Greek meaning “having multiple
forms”) is the characteristic of being able to assign a different meaning to a particular symbol or
“operator” in different contexts. The simple example is two classes that inherit from a common
parent and implement the same virtual method.
22.Definition: Abstraction
Through the process of abstraction, a programmer hides all but the relevant data about an
object in order to reduce complexity and increase efficiency. In the same way that abstraction
sometimes works in art, the object that remains is a representation of the original, with
unwanted detail omitted. The resulting object itself can be referred to as an abstraction,
meaning a named entity made up of selected attributes and behavior specific to a particular
usage of the originating entity.
23.What is UML ?
UML (Unified Modeling Language) is a standardized modeling language. It is used for
the specification, construction, visualization and documentation of models for software systems
and enables uniform communication between various users.
UML does not describe the steps in the object-oriented development process.
SAP uses UML as the company-wide standard for object-oriented modeling.
3|Page
UML describes a number of different diagram types in order to represent different views
of a system.
4|Page
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.
33.What is a singleton ?
If it is to be impossible to instantiate a class more than once (for example, because it serves as
a data administrator or data container), you can use the singleton concept. The class is defined
with the addition CREATE PRIVATE and FINAL and instantiated using its static constructor. A
public static component could then make the reference to the class available to an external
user.
5|Page
37.How is Encapsulation implemented in OOPs ?
Encapsulation means that the implementation of an object is hidden from other components in
the system, so that they cannot make assumptions about the internal status of the object and
therefore dependencies on specific implementations do not arise.
6|Page
45.What Is The Difference In An Instance Method And A Static Method?
Instance method is available separately in each object (instance), static method is global and no
instance is required for static method.
47.What Is The Difference Between Singleton And Static Class In Sap Abap ?
Before going to static classes, you should understand static components.
Static Components: Static components (static attributes, static events and static
methods) exists globally, no need to create object/instance of the class to access them, we can
access them by using static component selector => .
Static Class: A class that only contains static components and no instance components
is referred to as a static class.
Singleton Class: It is a class which does not allow you to create multiple instances.
7|Page
Use set handler and register event handler method to a particular instance in the
program
8|Page
We can also place different UI elements like checkbox, Radiobutton on the same screen
in addition ALV grid data.
65.What Is Alias?
Instead of specifying full name of interface methods, we can assign it a name which can directly
trigger.
66.What Is Me Variable?
It just like a selfreference, by this we can call methods that are with in same class with out
creating object.
9|Page
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).
For example take one static method with an exporting parameter inside private class and write
object creation code in that static method and export that object.
10 | P a g e