Sunday, May 2, 2010

Comments & Separator

Comments are descriptions that are added to a program to make code easier to understand. The compiler ignores comments and hence its only for documentation of the program.
Java supports three comment styles.
Block style comments begin with /* and terminate with */ that spans multiple lines.

Line style comments begin with // and terminate at the end of the line. (Shown in the above program).

Documentation style comments begin with /** and terminate with */ that spans multiple lines. They are generally created using the automatic documentation generation tool, such as javadoc. (Shown in the above program)
name of this compiled file is comprised of the name of the class with .class as an extension.

Separator

The most commonly used separtor in java is Seni-colon(;).It is used to terminate the Statements.The Separators are Shown in the following:

( )  parenthese-Used to contain list of parameters in method definition and invocatin.
{ }  Braces- used to contain the values of automatically initialize arrays.
[ ]  Brackets- Used to declare Array type.
;    Semicolon - Terminates Statements.
,    Period- Used to Separate packages Name from subpackage and classes.

No comments: