wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Extra ; after Curly bracket close does't effect? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Extra ; after Curly bracket close does Watch "Extra ; after Curly bracket close does New topic
Author

Extra ; after Curly bracket close does't effect?

Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62


Rajeev Kumar
SCJP 6.0 Certified 96%
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
even this won't have an effect.


;-) .. it's called an empty statement

JDBCSupport - An easy to use, light-weight JDBC framework -
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62

int i = 0;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Thanks I was confused with Anonymous Inner class where ; is necessary otherwise compilation fail.
I hope that is the special case.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
not the only special case. When using enums with a constructor and arguments passed you are forced to end the last item with a semicolon when you're not to without a constructor.
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62
Sebastian Janisch wrote:not the only special case. When using enums with a constructor and arguments passed you are forced to end the last item with a semicolon when you're not to without a constructor.


If I understand correct: Anum declaration within a class require(must use) ending };(semicolon) if we declare a constructor/method/variable inside enum declarion right??.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Check this



the semicolon after Item3 must be there, when however in the example before it can but doesn't have to be there.
Rajiv Chopra
Ranch Hand

Joined: Dec 19, 2008
Posts: 62

the semicolon after Item3 must be there, when however in the example before it can but doesn't have to be there.


Thankyou very much...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extra ; after Curly bracket close does't effect?