A
A
alist2011-06-30 12:59:00
Java
alist, 2011-06-30 12:59:00

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

1 answer(s)
A
antalus, 2011-06-30
@alist

Window -> Preferences -> Java -> Code Style -> Code Templates -> Code -> Method Body -> Edit…

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question