Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Declarations →  Declaration Statements →  Classes and Interfaces →  ABAP Objects - Overview →  Examples for ABAP Objects 

ABAP Objects, Friendship

This example demonstrates an interface that is a friend of a class.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    cl_demo_output=>display( cl_demo_friendship=>attr ).

Description

The empty global interface IF_DEMO_FRIEND is a friend of the global class CL_DEMO_FRIENDSHIP. Every class that implements IF_DEMO_FRIENDSHIP can access the private components of CL_DEMO_FRIENDSHIP.