Differents kind of classes inherit from an abstract class in android java -
Differents kind of classes inherit from an abstract class in android java -
i have 2 classes (classa , classb) should listfragment. these 2 classes share behavior,thus created abstract class(abstractclass). abstractclass inherit listfragment. far have classa , classb inherit abstractclass inherit listfragment. problem comes when need classc should fragment(not listfragment) need behavior abstractclass, cant inherit because classc should fragment , abstractclass listfragment. have classa,classb , classc inherit abstractclass beingness classa,classb listfragment , classc fragment. im sure should design pattern in java or practice solve this.
i know java not allow multiple inheritance.
many thanks
can extract mutual functionality helper class? utilize composition instead of inheritance
java android oop
Comments
Post a Comment