Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Comments

You must also write comments to explain to humans what the program does.

Tutorial Details:

Computer programs are read by both computes and humans. You write Java instructions to tell the computer what to do. You must also write comments to explain to humans what the program does. Of course, Java can't understand them because they are written in English, or Spanish, or Thai, or ... .

Java ignores all comments. There is, however, a program called javadoc which reads certain kinds of comments and produces HTML documentation (see below).

Spaces and blank lines
One of the most effective ways to make a program readable is to put spaces in at key points. There are several styles for doing this. Even more important is to put blank lines in your program. These should separate sections of code. There should be a blank line between each "paragraph" of code. By paragraph, I mean a group of statements that belong together logically; there is no Java concept of paragraph.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/language/10basics/10comments.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Comments

View Tutorial:
Comments

Related Tutorials:

Java Tip 70: Create objects from jar files! - JavaWorld - March 1999
Java Tip 70: Create objects from jar files! - JavaWorld - March 1999
 
Improve the robustness and performance of your ObjectPool - JavaWorld - August 1998
Improve the robustness and performance of your ObjectPool - JavaWorld - August 1998
 
How to attach a user interface to a Jini service - JavaWorld October 1999
How to attach a user interface to a Jini service - JavaWorld October 1999
 
Survival of the fittest Jini services, Part 1 - JavaWorld April 2001
Survival of the fittest Jini services, Part 1 - JavaWorld April 2001
 
Make bad code good - JavaWorld March 2001
Make bad code good - JavaWorld March 2001
 
Talking Java! - JavaWorld August 2001
Talking Java! - JavaWorld August 2001
 
Doclet your servlet!
Doclet your servlet!
 
Build database-powered mobile applications on the Java platform
Build database-powered mobile applications on the Java platform
 
Implement Design by Contract for Java using dynamic proxies
Implement Design by Contract for Java using dynamic proxies
 
Create a quick-and-dirty XML parser
Create a quick-and-dirty XML parser
 
OpenSign
OpenSign OpenSign is a java applet for signing text in a webbrowser using a PKCS-12 key-files or keys located in MS Crypto API CSP's in a Win32 environment. The applet is based on code kindly provided by IT-Practice and everyone is encouraged to subm
 
Java Development on Eclipse, Part 2
Java Development on Eclipse, Part 2 Editor's note: In part one of this two-part series of excerpts from Eclipse, author Steve Holzner provided examples of how Eclipse makes it easier to create Java code from scratch. Continuing in that vein, in this we
 
Java theory and practice: Kill bugs dead
Inspection tools like FindBugs provide a second layer of defense against common coding errors.
 
JPOX Java Persistent Objects JDO
Presenting JPOX With a versatile and high performance implementation, JPOX is on the cutting edge of the available Java Data Objects (JDO) implementations, offering a free and full compliant JDO implementation released under an open source license.
 
Reduce code bloat with XDoclet
Reduce code bloat with XDoclet XDoclet can easily be one of the more versatile cross-technology code-generation tools in your Java programming toolbox. Unfortunately, developers often overlook XDoclet's general utility and use it only when it's bundled a
 
They just work
Writing CSV files: CSVPrinter This class makes it easy to output CSV. Given values, it will automatically determine if they need to be quoted and escape special characters. Comments can easily be written and correct line beginnings will be added.
 
Download Search Engine Code its free and Search engine is developed in Servlets
Download Search Engine Code its free and Search engine is developed in Servlets Download Search Engine Code Installation Instruction Download and unzip the file into your favorite directory. Create a database on your MySQL Server. Run all the
 
Building Search Engine Applications Using Servlets !
Building Search Engine Applications Using Servlets ! Building Search Engine Applications Using Servlets Please visit http://www.webappcabaret.com/javadevelopers/search to see running copy of our search engine. Introduction This tutorial takes
 
Beginner to advance guide to the Apache Struts
Beginner to advance guide to the Apache Struts The Complete Apache Struts Tutorial This complete reference of Jakarta Struts shows you how to develop Struts applications using ant and deploy on the JBoss Application Server. Ant script is provided
 
Solaris 10 OS Certification Beta Exams
If you are an expert in system and network administration, you can get involved in the creation of three new Solaris 10 certification exams. These Beta exams count toward official Solaris Certification and allow you to provide comments and technical feedb
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.