Comment in a program : In java,these are the three types of - TopicsExpress



          

Comment in a program : In java,these are the three types of comment statement.They are 1.Single line comment(//) 2.multi line comment(/* and */) 3.Documentation comment(/** and */) It helps the code more readable. Single line Comment : For a single line comment we use (//)to begin a comment.It ends at the end of the line. e.g.: int a=10;//assign 10 to a Book b=new Book();//create an object Multiline Comment If the comment exceeds more than one line,we can use the multiline comment.Here we start with /* and end with */. e.g.: /* this is a second java program called this file "second.java" */ Note:Anything between the comment symbol ignored by the compiler. Documentation comment It begin with the character sequence /**,it ends with a */.If you are using this type of comment,javadoc utility program to extract the information and out into an html file: the javadoc utility recognizers the following tag. Tag Meaning 1.@author--> Identifies the author of a class. 2.@deprecated -->Specification for deprecation. 3.@exception--> Any exception thrown by a method 4.@return--> Method returns a value 5.@see--> Specific link to another topic. 6.@throws--> Same as exception. 7.@version--> Specifies the version of a class. e.g.: /** This class is demo for documentation comments @author Santanu Acharya @version 1.0 */
Posted on: Fri, 09 Aug 2013 12:20:03 +0000

Trending Topics



Recently Viewed Topics




© 2015