Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comment block format

 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When I hit Source->Format in NetBeans, in turns this:

into this:

Suggestions on a style that doesn't get re-formatted by NetBeans?

Thanks.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what formatting NB or other IDEs might apply to a given comment form, especially a non-standard one like that, but I'd go with:



But in general you shouldn't need those section markers.

Note that comments that start with /** are interpreted by the javadoc tool, so probably NB is reformatting to fit the more standard

format, where the javadoc marker /** is immediately followed by a newline.

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I want block comment like that I use single-line comments:



I don't think the IDE reformats single-line comment.
 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic