I have a simple interface:
public interface MyInterface{
public void method1();
}
What I want is that whenever a class implements MyInterface
, the correspondig methods will always have a default code. When I write implements MyInterface
I want to be able to use Eclipse's suggestion in order to add the code automatically. For example:
public class SomeClass extends AClassImForcedToExtendDueRequirements implements MyInterface{
...
/*Now I use Eclipse's code-completition suggestion*/
}
And then I would like to have this situation:
public Class SomeClass extends AClassImForcedToExtendDueRequirements implements MyInterface{
...
@Override
public void method1(){
System.out.println("This is a default line of code, added automatically!");
}
}
So, how can I edit the Interface? Thank you