This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes comments in Java Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "comments in Java Class" Watch "comments in Java Class" New topic
Author

comments in Java Class

Abdul Kader
Ranch Hand

Joined: Apr 11, 2007
Posts: 115
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

Joined: Oct 27, 2005
Posts: 19672
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: comments in Java Class