Presentation is loading. Please wait.

Presentation is loading. Please wait.

Javadoc CSC 172 SPRING 2002 EXTRA LECTURE TWO AMAZING FACTS The average college student spends $375/yr on textbooks. The average college student spends.

Similar presentations


Presentation on theme: "Javadoc CSC 172 SPRING 2002 EXTRA LECTURE TWO AMAZING FACTS The average college student spends $375/yr on textbooks. The average college student spends."— Presentation transcript:

1

2 Javadoc CSC 172 SPRING 2002 EXTRA LECTURE

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

4 JAVADOC A documentation comment can be extracted and used by the javadoc utility to generate HTML documentation for a program begins with “/**” ends with “*/”

5 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

6 Example /** * This class implements a generic stack. An array is * used to implement the stack. * @author K.A.M. * @version 1.1 */ public class Stack{ /*class def*/ }

7 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 “@” ends the general description section and begins the Javadoc tags

8 Javadoc Tags General syntax @ Tags with the same name must be grouped together Some tags have pre-assigned formatting Text can contain HTML tags

9 Common Javadoc tags C=class, I==interface,M=method,V=Member Variable @authorC,ISpecifies author @deprecatedC,I,M,VSpecifies deprecation @exceptionMSpecifies exception thrown {@link}C,I,M,VCreates an in line hyperlink @paramMMethod parameter @returnMReturn value @seeMCreates a hyperlink @sinceC,I,M,VSpecifies version introduced @throwsMSame as @exception @versionC,IStates current version

10 Example Run


Download ppt "Javadoc CSC 172 SPRING 2002 EXTRA LECTURE TWO AMAZING FACTS The average college student spends $375/yr on textbooks. The average college student spends."

Similar presentations


Ads by Google