Index

chapter1

chapter2page1

chapter2page2

chapter2page3

chapter2page4

chapter2page6

chapter2page7

chapter2page8

chapter2page9

chapter2page10

chapter2page11

chapter2page12

chapter2page13

chapter2page14

chapter2page15

chapter2page16

chapter2page17

chapter2page18

chapter2page19

chapter2page20

chapter2page21

chapter2page22

chapter2page23

chapter2page24

chapter2page25

chapter2page26

chapter2page27

chapter2page28

chapter2page29

chapter2page30

chapter2page31

chapter2page32

chapter2page33

chapter2page34

chapter3

link one

link one

link one

link one

link one

link one

2.5 - Comments

In Java programming language there is two types of comments. First type of comments is called single line coments. Single line comments are should end at the line they are declared. Single line comments begin with double slash characters like

....... // Comment begins from here

Java compiler ignores the double slash and the characters following it. These characters are considered as an information to any one reading the source code.

The second type of comments may exceed the line and therefore they are called as multiline comments.

Multiline comments are the lines between /* and */ Example:

Multiline comments are not compiled . They are useful when a comment is more verbose and needs more than one line for the informations included in the comment.

/*
This is a comment part
*/

Javadoc comments are special cases of multiline comments. These comments are evaluated by the Javadoc utility provided with JVM platform. This utility is usedfor generating automatised information file of the program in HTML format. Javadoc commnets are illustrated below:

/**
*This is a javadoc comment
**/

Comments are very important for the programs. A program once written, is like living body. It needs constant care, it needs development, it needs better presentation, it needs more elaborate methods, it needs corrections for defectous code, it needs more elaborate error handling etc...There should be always a maintenance work on the source codes and the staff undergoing the code maintenance is not generally the same staff who has produced the codes. Nothing will be changed even it were the same, since anybody who has produced some codes, is likely to forget it in a maximum of six months time. Therefore commenting has utmost importance and codes without comments may be very hard to decipher even by the person who produced them. Scott Ambler suggests that the source codes should be as commented as possible. According to him, even a textual explanation page, accompagning the codes will be very helpful. We can be more moderate on the subject, but commenting should never be neglected in the program production.

<< Index

Polyglott HTML5(XHTML5 compliant HTML5 code)