• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bizarre declaration  RSS feed

 
Shalini Srivastav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Any comment about it ?
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Context? Why is this something you or we should bother with?
 
Shalini Srivastav
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never used colon after declaration of classes or interfaces lol.
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A semi-colon indicates the end of a statement or line of code in Java, even an empty one.

The second line of your post is the same as,

An empty class, MyClass, followed by an empty line of code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!