Basic Java Language: Difference between revisions

wikademia>Geonautika
wikademia>Geonautika
Line 74: Line 74:
Comments can also be written on multiple lines by starting with '''/*''' and ending with'''*/'''.
Comments can also be written on multiple lines by starting with '''/*''' and ending with'''*/'''.


<pre>
<source lang="java">
/*
/*
Comment 1  
Comment 1  
Line 80: Line 80:
Comment 3
Comment 3
*/
*/
</pre>
</source>


A multi-line comment that opens with two asterisks
A multi-line comment that opens with two asterisks


<pre>
<source lang="java">
/**
/**
Like this
* Like this
*/
*/
</pre>
</source>


is called a '''javadoc comment'''. As a general rule, don't use these unless you mean to run the javadoc program on your code. We won't worry about these kind of comments for now.
is called a '''javadoc comment'''. As a general rule, don't use these unless you mean to run the javadoc program on your code. We won't worry about these kind of comments for now.