Java coding style in Eclipse

user697911 :

For each method, I want to add a space between the method name and the right curly bracket. For example,

public void setName(String name) {
}

I want a space between ) and {. Is it possible to automatically set this in Eclipse or somewhere? It's annoying to add this space every time.

z m :

Default code style will add space where you want it, and it can be autoformatted on every save:

Window->Preferences->Java->Editor->SaveActions: check "Format source code"

In case you want to change some of the default styles, you can do so if you navigate to formatter and edit active profile there:

Save Actions

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=475183&siteId=1