Document The Program Logic or Design
Document The Program Logic or Design
Document The Program Logic or Design
PROGRAM LOGIC OR
DESIGN
CODING THE PROGRAMS
Portable − The program or software should
run on all computers of same type. By same
type we mean a software developed for
personal computers should run on all PCs. Or
a software for written for tablets should run
on all tablets having the right specifications.
Efficient − A software that does the assigned
tasks quickly is said to be efficient. Code
optimization and memory optimization are
some of the ways of raising program
efficiency.
PROPER IDENTIFIER NAMES
• Javadoc is a tool which comes with JDK and it is used for generating Java code documentation in HTML
format from Java source code, which requires documentation in a predefined format.
• Following is a simple example where the lines inside /*….*/ are Java multi-line comments. Similarly, the
line which preceeds // is Java single-line comment.
EXAMPLE
You can include required HTML tags inside
the description part. For instance, the
following example makes use of
<h1>....</h1> for heading and <p> has
been used for creating paragraph break −
EXAMPLE
THE JAVADOC TAGS
The javadoc tool recognizes the following
tags −
EXAMPLE
Following program uses few of the
important tags available for documentation
comments. You can make use of other tags
based on your requirements.
The documentation about the AddNum
class will be produced in HTML file
AddNum.html but at the same time a
master file with a name index.html will also
be created.
Now, process the above AddNum.java file
using javadoc utility as follows −
HOW TO WRITE, GENERATE AND USE JAVADOC IN
ECLIPSE?
• To generate Java docs for your project you need to write the required information about the field,
method or class as.
• Then to generate the document follow the steps given in next slide −
STEP 1
Open eclipse, select the option Project
→Generate Javadoc.
STEP 2
Select the javadoc.exe file from the bin
folder of java installation directory,
select the destination folder for the
generated java doc and select Next.
STEP 3
Type the title of the documentation in
the Document title and select the
finish button.
STEP 4
Finally, you can observe the generated doc
files in the generated folder.
You can view the document by opening
the index.html file with the browser.
END