23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Comments<br />

Note the use of comments <strong>in</strong> this <strong>and</strong> other examples. These comments are<br />

annotations provided for human readers <strong>and</strong> are not processed by a <strong>Java</strong> compiler.<br />

<strong>Java</strong> allows for two k<strong>in</strong>ds of comments-block comments <strong>and</strong> <strong>in</strong>l<strong>in</strong>e commentswhich<br />

def<strong>in</strong>e text ignored by the compiler. <strong>Java</strong> uses a /* to beg<strong>in</strong> a block<br />

comment <strong>and</strong> a */ to close it. Of particular note is a comment that beg<strong>in</strong>s with /**,<br />

for such comments have a special format that allows a program called <strong>Java</strong>doc to<br />

read these comments <strong>and</strong> automatically generate documentation for <strong>Java</strong><br />

programs. We discuss the syntax <strong>and</strong> <strong>in</strong>terpretation of <strong>Java</strong>doc comments <strong>in</strong><br />

Section 1.9.3.<br />

In addition to block comments, <strong>Java</strong> uses a // to beg<strong>in</strong> <strong>in</strong>l<strong>in</strong>e comments <strong>and</strong><br />

ignores everyth<strong>in</strong>g else on the l<strong>in</strong>e. All comments shown <strong>in</strong> this book will be<br />

colored blue, so that they are not confused with executable code. For example:<br />

/*<br />

* This is a block comment.<br />

*/<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!