When would you put a semicolon after a method closing brace?
Posted
by froadie
on Stack Overflow
See other posts from Stack Overflow
or by froadie
Published on 2010-04-27T19:29:36Z
Indexed on
2010/04/27
19:33 UTC
Read the original article
Hit count: 327
I've been programming in Java for a while, and I've just come across this syntax for the first time:
public Object getSomething(){return something;};
What's interesting me is the final semicolon. It doesn't seem to be causing a compiler error, and as far as I know isn't generating runtime errors, so it seems to be valid syntax. When would I use this syntax? Or is it just something that is allowed but generally not used?
© Stack Overflow or respective owner