相关疑难解决方法(0)

Java中的花括号是什么意思?

我有一些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);
Run Code Online (Sandbox Code Playgroud)

在第一个if声明之后,那些独立的花括号是什么意思?

java syntax scope curly-braces

76
推荐指数
4
解决办法
4万
查看次数

标签 统计

curly-braces ×1

java ×1

scope ×1

syntax ×1