Answer the question
In order to leave comments, you need to log in
Eclipse: how to change the default body of methods in Java
Suppose I create a Java class and add an interface with one method to it:
int getSize()
Eclipse automatically substitutes the method body via add unimplemented methods:
All this is great, but I would like the method body to look like:
There is probably a setting in the IDE, but I can’t find it in any way.
@Override
public int getSize() {
return 0;
}
@Override
public int getSize() {
throw new UnsupportedOperationException("Not implemented yet");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question