进入Eclipse,选择Window -> Preference;选择Java -> Code Style -> Formatter,点击Active profile中的Edit…; 进入到如下窗口后,进行你想要的修改。修改完后点击Apply;回到之前的窗口,点击Apply和Apply and Close;选择Source -> Format,然后你的代码就自动更改为你想要的格式了。