Example

 

The ABAP program can access the public components of the object using the reference variable CREF1, that is in this case, it can call the public methods of the class C_COUNTER. After the program on the left-hand side has been executed, the program variables NUMBER and the private object attribute COUNT both have the value 8.