I know about static initialization blocks and double brace initialization.
But what about extra braces in a method.
The compiler does not throw any exception for the following code:
public static void main (String [] args) {
String hello = "Hello";
{
System.out.print(hello);
{{{{{
System.out.println(" world!");
}}}}}
}
}
So why does this work? Shouldn't it throw java.lang.Error?