Java Question How I will extend a B4j or b4a class ?

avacondios

Active Member
Licensed User
Longtime User
Hi,

I am writing a generic class (ex: clsAnimals) on b4j. Then, I am creating a new b4j class (ex: clsLion), which I want to extend any other existing class on my code ( on my example, the clsAnimal).

Is it possible to add the #Extend property and on the beginning of the new class to define if the existing class extends any existing class ?

Also, if I have loaded an external library from libs, is it possible to extend a b4j class from a loaded library which it written on eclipse ?
 

luke2012

Well-Known Member
Licensed User
Longtime User
It is not possible to extend a class as there is no support for inheritance. However in most cases you can composition instead of inheritance. Composition is better than inheritance in most cases.

@Erel what you mean for composition ?
 
Top