Javadoc - PowerPoint PPT Presentation

About This Presentation
Title:

Javadoc

Description:

Javadoc – PowerPoint PPT presentation

Number of Views:242
Avg rating:3.0/5.0
Slides: 10
Provided by: thaddeusf
Category:

less

Transcript and Presenter's Notes

Title: Javadoc


1
Javadoc
  • CSC 172
  • SPRING 2002
  • EXTRA LECTURE

2
TWO AMAZING FACTS
  • The average college student spends 375/yr on
    textbooks.
  • The average college student spends 1750/yr on
    pizza and beer.

3
JAVADOC
  • A documentation comment
  • can be extracted and used by the javadoc utility
  • to generate HTML documentation for a program
  • begins with /
  • ends with /

4
Documentation comments
  • A single documentation comment can be placed
    immediately preceding
  • Class and interface definitions
  • Member method definitions
  • Member variable definitions
  • If placed elsewhere, it is treated as a regular
    comment

5
Example
  • /
  • This class implements a ltigtgeneric stacklt/igt.
    An array is
  • used to implement the stack.
  • _at_author K.A.M.
  • _at_version 1.1
  • /
  • public class Stack /class def/

6
Inside the comment
  • Leading white space asterisks are ignored
  • The first sentence is used as a summary
  • A period ends the first sentence
  • HTML tags allowed
  • The first line beginning with _at_ ends the
    general description section and begins the
    Javadoc tags

7
Javadoc Tags
  • General syntax
  • _at_lttag-namegt lttextgt
  • Tags with the same name must be grouped together
  • Some tags have pre-assigned formatting
  • Text can contain HTML tags

8
Common Javadoc tagsCclass, Iinterface,Mmethod
,VMember Variable
_at_author C,I Specifies author
_at_deprecated C,I,M,V Specifies deprecation
_at_exception M Specifies exception thrown
_at_link C,I,M,V Creates an in line hyperlink
_at_param M Method parameter
_at_return M Return value
_at_see M Creates a hyperlink
_at_since C,I,M,V Specifies version introduced
_at_throws M Same as _at_exception
_at_version C,I States current version
9
Example Run
Write a Comment
User Comments (0)
About PowerShow.com