class - Extending multiple classes in java -


this question has answer here:

i have java class extends class. have found need inherit yet class , not sure how this. have tried class implements class b, class c. not work. class extends class b. need inherit class c. have tried create interface extends class c, says interface cannot extend class. not sure now..

you need c extends b extends a. or using interface u can multiple inheritance in java. jdk 1.8 defalut feature has been added multiple inheritance using interfaces.


using composition on inheritance

update : can use this

class seaplane implements vehicle {   private vehicle plane,                 ship;   @override   public void safetycheck() {    plane.safetycheck();    ship.safetycheck()    } } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -