在Java中,以下内容完全有效:
if (x == null)
Y();
else
Z();
Run Code Online (Sandbox Code Playgroud)
我个人根本不喜欢它.我喜欢我所有的IF语句都有括号:
if (x == null) {
Y();
} else {
Z();
}
Run Code Online (Sandbox Code Playgroud)
eclipse格式化程序非常棒,可以通过许多其他方式美化我的代码.
有没有办法让它为IF语句添加大括号?