Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comments in Java Class

 
Abdul Kader
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we give a comment in between methods so that other developer can understand the functionality easily? I do follow some methods to do that, however I am interested to know any standard way to do this. Because already have javadocs which will help us to create the documentation for the java class, like wise is there any way comments in Java Class´┐Ż
 
Rob Spoor
Sheriff
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are three types of comments in Java:
- single line comments start with //, and end when the line ends
- multi line comments start with /* and end with */
- JavaDoc comments start with /** and end with /*

Now you can use any of these comment types anywhere in your code. JavaDoc just has special meaning, but it can still be placed inside methods. It just won't have any JavaDoc created then, but it is possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic