Java switch cases: with or without braces?

is there any sort of performance penalty for using the braces with a case?

None.

The curly braces are there to help the compiler figure out the scope of a variable, condition, function declaration, etc. It doesn’t affect the runtime performance once the code is compiled into an executable.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)