Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
Java Language EssentialsDownload tutorial zip fileEmail this tutorial to a friend
Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
Course Notes
  


Comment syntax page 6 of 37


Java(TM) syntax supports three types of commenting, illustrated in the following table:

Comment ExampleDescription
int x; // a commentRemainder of line beginning with "//" is a comment area
/*
The variable x is an integer:
*/
int x;
All text between the "/*" and "*/", inclusive, is ignored by compiler
/**
x -- an integer representing the x coordinate
*/
int x;
All text between the "/**" and "*/", inclusive, is ignored by compiler and intended for javadoc documentation utility

The javadoc documentation tool is quite powerful. The standard Java distribution from Sun includes documentation built with javadoc; hence, one avenue for learning this tool is to study the HTML documentation alongside the Java source code, which contains the comments that javadoc converts into HTML.


copyright 1996-2000 Magelang Institute dba jGuru


Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
PrivacyLegalContact