Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

oops

Former Member
0 Kudos

hi all,

what is instance and interface?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

<b>Instance</b>Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. <b>Each instance (object)</b> of a class has a unique identity and its own set of values for its attributes.

<b>Interface</b>Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.

Interfaces only describe the external point of contact of a class (protocols), they do not contain any implementation.

Interfaces are usually defined by a user. The user describes in the interface which services (technical and semantic) it needs in order to carry out a task.

The user never actually knows the providers of these services, but communicates with them through the interface.

In this way the user is protected from actual implementations and can work in the same way with different classes/objects, as long as they provide the services required. This is known as polymorphism with interfaces.

<b>Reward if useful</b>

2 REPLIES 2

Former Member
0 Kudos

HI

<b>Instance</b>Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. <b>Each instance (object)</b> of a class has a unique identity and its own set of values for its attributes.

<b>Interface</b>Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.

Interfaces only describe the external point of contact of a class (protocols), they do not contain any implementation.

Interfaces are usually defined by a user. The user describes in the interface which services (technical and semantic) it needs in order to carry out a task.

The user never actually knows the providers of these services, but communicates with them through the interface.

In this way the user is protected from actual implementations and can work in the same way with different classes/objects, as long as they provide the services required. This is known as polymorphism with interfaces.

<b>Reward if useful</b>