mardi 28 juillet 2015

Two Interface with Same Method Name - Implementation of Methods

Suppose I have two interface -

interface IOne{

   public void method();

}

and -

interface ITwo{

       public void method();

}

A concrete class implements both of the interface -

public class A implements Ione, ITwo{

    public void method(){
       //some implementation
    }
}

My questions are: -

1 Does the single implementation of method() one suffice for both interface IOne and ITwo?

2. If the answer of 1 is yes, is there any way to get both the method in a single class? In this case it is not necessary we have to implement both interface in a single class.

Aucun commentaire:

Enregistrer un commentaire