File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classes

 
lakshmi suji
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in classes syntax at the last can we give a semicolon
if we give then will it show any error or not?
ex:
class Example
{
};
 
ganesh pol
Ranch Hand
Posts: 151
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't u compile it and see by the way i think u are talking about anonymus classes
 
Philip Heller
author
Ranch Hand
Posts: 119
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class definition ends at the closing curly bracket. The compiler thinks the semicolon marks the end of an empty statement. So you could even have:

which is a class definition followed by 10 empty statements.

The class is not necessarily inner.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Empty statements are almost always perfectly harmless.

I heard of a shop where programmers were rated by lines of code per month. The program that counted lines was not very smart, and people started decorating comment blocks like:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic