How to Explicitly implement 2 interface method that having same signature in java? -


this question has answer here:

i have 2 interface this:

interface ia{    void show(); }  interface ib{    void show(); } 

now want implement both interface method explicitly class.

in c# can using "explicit interface implementation method" this:

interface ia {    void show(); } interface ib {    void show(); }  class derived : ia, ib {     void ia.show()     {         console.writeline("hello c#!");     }     void ib.show()     {         console.writeline("hello world !");     }  } 

is there way or keyword java solve problem?

as long both methods have same return type, can implemented single method within class.

otherwise, cannot implemented , compile error viewed.

there no way in java explicitly implement each method per interface.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -