extends - Java: Break-up "implement" into two+ classes -
i've got plugin architecture java application i'm working with.
all examples show:
public class specialname implements baseextenderclass, classb, classc { //stuff }
where "specialname" name have name class in order recognized plugin, , baseextenderclass, classb, classc different api functionality extended in 1 class operations. each 1 has own methods must implemented.
what i'm wondering if there way in java can put classb , classc in separate files baseextenderclass specialname, , still have behave intensive purposes if original code listed above.
the code lot neater , more organized since plugin i'm writing extend 6-8 of available api interfaces.
if not, can have 1 massive file... doesn't feel right way things.
are trying split interface definitions or implementation code them ?
i assuming saying don't want put implementation code 3 interfaces in same class rather need separate 2 or more files (classes) because commented on potential size.
if case (and i'll assume have reason doing so), should able create intermediate class implements classb , classc, inherit one.
something this...
public class tmpclass implements classb, classc { //put implementation these 2 interfaces here } public class specialname extends tmpclass implements baseextenderclass { //add implementation baseextenderclass interface here }
Comments
Post a Comment