In this section we will see how to comment your Java code.
We will also see the Identifiers and Keyword of Java API.
Properly commenting the Java code is very important. Commenting the programming code is one of the best practices of good programming. You should always comment your Java code properly.
Java provides three different methods of commenting the code.
Following table summarizes the different methods of commenting code.
a) Use // for commenting
b) Use /* .... */ for commenting
c) Use /** ..... */ for commenting in Java code
Java compiler ignores the text marked as comment.
Comments// Everything to the end of the line is ignored. Use for most comments.
/* Everything (possibly many lines)
is ignored until a */. Uncommon. Use for commenting out code.
/** Used for automatic HTML documentation generation
by the javadoc program. */
Identifier Names
KeywordsThe keywords are divided into three categories by expected student usage.
Maybe
Variables - Local, Instance, ClassVariables may be local, instance (field), or static (class) variables. Formal parameters are local variables that are assigned values when the method is called.
|