I'm learning Scala and confused about the try-catch-finally
syntax.
In Scala Syntax Specification, it says:
Expr1 ::= ‘try’ Expr [‘catch’ Expr] [‘finally’ Expr]
| ...
Can I write expression without {
}
blocks like this:
try
println("Hello")
catch
RuntimeException e => println("" + e)
finally
println("World")
Or the expression must be a block expression ?