When we want to create our software in ABAP OOP technology, we need to know the differences between static and instance methods as well. The same is applicable for attributes.
Why are these differences so important? Imagine we have a car and we want to accelerate by 10 km/h. In this case, we would need to press the gas pedal for the car to accelerate. In Objects, we can describe this as using the Accelerate
method, which changes the SPEED
instance attribute in the instance of the CAR
class. This example shows us that an action should not be made without reference to something.
When we speak about static attributes, these can be changed without reference to any object. Also, a static method can be executed without any reference. Instance attributes or an instance method can be used only with reference to the object on which the operation is to be performed.
Instances of the same class can be created multiple times during runtime, but static attributes...