mardi 28 avril 2020

How can I initialize an object of type interface with a constructor from a class that implements the parent interface?

I have interface Worker, interface Painter that extends Worker and Person that implements Worker. How do I create a Person that is also a Painter?

Do I have to create a subclass from Person?

Why does

Painter painter = new Person();

not work?

Aucun commentaire:

Enregistrer un commentaire