Home Demos Forum Research Guide
Viewing topic in forum 'general'
back to topic list

Interface Inheritance
Is it possible for and interface to extend another interface?
by enesi on 2015-06-10 13:39:29 (2 replies)

Hi,

Yes, an interface can extend another interface using the "extends" keyword. This works essentially like inheritance in Java, so the subtype has all the functions of the supertype.

You can see examples of this in resources/ui/, for example the Button interface, in Button.dn, which extends ClickableObject.

Note that if a component does not provide an implementation for all of the functions in the supertype of an interface that it provides, it must have a required interface of that supertype (the compiler will tell you this where necessary).

Hope that helps - let me know if you have any more specific questions about how this works.

- Barry
by barry on 2015-06-10 22:03:35
Quick update: we've now added a documentation section on inheritance for interfaces in the programming guide, also explaining how function overriding works.
by barry on 2015-06-19 11:05:43
© Francis Research Ltd. 2017