mardi 23 octobre 2018

Implementation to subclasses java

How to forward the implementation to subclasses without implement the function from interface?

interface A { void function f();}

class B implements A {/* some functions and attributes **/
    @Override
    void function f(){/* empty , i don't need it*/}
}
class C extends B{
   @Override
   void function f(){/* implementation*/}
}
class D extends B{
   @Override
   void function f(){/* implementation*/}
}

How can i remove the override in class B ?

Aucun commentaire:

Enregistrer un commentaire