File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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?
 
Similar Threads
Two public classes
Need Help! How can I......
Programming to interface but need access to implementation for persistence
How to make my class iterable?
How To Sort Multiple Columns