Application Development and Automation 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: 
Read only

Interface extending Interface

Former Member
0 Likes
1,148

How one interface can extend another interface?

In classes we can use INHERITING FROM but this is not working in case of interface. Is there anyother solution

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
836

I think you want to use nesting of interfaces.

Please refer http://help.sap.com/saphelp_nw70/helpdata/EN/c3/225b6254f411d194a60000e8353423/frameset.htm

- section Nesting Interfaces

- section Interfaces and Inheritance -> this of course is not abouth inheritance (as this is not possible from interface) but about polymorphism via interfaces.

Regards

Marcin

3 REPLIES 3
Read only

Sm1tje
Active Contributor
0 Likes
836

Looks like you are using a local class, correct? Like in a class you can also add an interface to your interface. But you can also add several interfaces to your class.

What is it you are trying to accomplish here? In classes obviously the inheritance is used to specialize the subclass(es). But in your case I don't see why you would want to have something alike. Interfaces do not use inheritance.

Read only

MarcinPciak
Active Contributor
0 Likes
837

I think you want to use nesting of interfaces.

Please refer http://help.sap.com/saphelp_nw70/helpdata/EN/c3/225b6254f411d194a60000e8353423/frameset.htm

- section Nesting Interfaces

- section Interfaces and Inheritance -> this of course is not abouth inheritance (as this is not possible from interface) but about polymorphism via interfaces.

Regards

Marcin

Read only

naimesh_patel
Active Contributor
0 Likes
836

Interface doesn't represent the actual object unless you implement that interface in the class. So, you can't inherit the interface with another interface.

You can implement this interface in the class say Super Class and inherit your a Sub class from this Super Class. In the Sub Class, you can implement a new interface which is only specific to subclass.

Regards,

Naimesh Patel