12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16 chapter 1Package Class Tree Deprecated Index HelpPREV CLASS NEXT CLASSSUMMARY: NESTED FIELD CONSTR METHODFRAMES NO FRAMES All ClassesDETAIL: FIELD CONSTR METHODClass TrapMethodsjava.lang.Object+––TrapMethodspublic class TrapMethodsextends java.lang.ObjectTrapMethods.java by RH Landau, trapezoid-rule integration with method callsField Summarystatic double ABstatic doublestatic intNConstructor SummaryFigure 1.6 A sample of the automatic code documentation produced by running javadoc.1.4.7 Automatic Code Documentation ⊙A nice feature of Java is that you can place comments in your code (alwaysa good idea) and then have Java use these comments to create a professionallookingHypertext Markup Language (HTML) documentation page (Figure 1.6).The comments in your code must have the form✞☎✝/∗∗ DocDemo. java : with javadoc comments ∗/public class TrapMethods {public static final double A = 0., B = 3.;/∗∗ main method sums over pointscalls wTrap for trapezoid weightcalls f(y) for integrand@param N number of data points@param A f irst endpoint@param B second endpoint ∗/Here the comments begin with a / ** , rather than the standard / * , and end withthe standard / * . As usual, Java ignores the text within a comment field. For this towork, the comments must appear before the class or method that they describe and−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!