【发布时间】:2010-09-19 10:59:17
【问题描述】:
我有一些 Java 代码以两种方式使用花括号
// Curly braces attached to an 'if' statement:
if(node.getId() != null)
{
node.getId().apply(this);
}
// Curly braces by themselves:
{
List<PExp> copy = new ArrayList<PExp>(node.getArgs());
for(PExp e : copy)
{
e.apply(this);
}
}
outAMethodExp(node);
第一个 if 语句之后的独立花括号是什么意思?
【问题讨论】:
标签: java syntax scope curly-braces