COP 2210Laboratory 8

Java Documentation Comments and Packages

Partner 1 Name and Section:______

Partner 2 Name and Section:______

Objectives:

To practice creating and using packages

To practice writing Java documentation comments for our classes, methods, parameters,

and return values, and creating the html “help” pages

As discussed in class, you will not be able to complete this lab on the network drive. Instead, create your project on a flash drive, laptop, or on your partition of the C: drive

Begin by downloading these 2files from the class web page and storing them in the src folder of your project:

Circle.javaTime.java

Exercise 1:

Refer to the online documents “Java Documentation Comments”, “Packages”and “Using the Javadoc Utility in NetBeans” for help

  1. Open and examine Circle.java. Note the Java “documentation comments” for the class and for each method, parameter, and return value
  1. Create a package with an appropriate name in the src folder of your project
  1. Using the Refactor command, move Circle.java into your package folder
  1. Generate the html “help” pages for the Circle class
  1. Open the file Circle.htmlin your browser (or NetBeans) and note how each documentation comment appears in the web page
  1. Open the file CircleTest.java and note that NetBeans has added the necessary import statement. Also note that the required package statement has been added to Circle.java

Check: ______

Exercise 2:

  1. Open Time.java and carefully read the comments describing the class and methods
  1. Using Circle.java for reference, add the proper Java documentation comments to the Time class. Be sure to document the class and every method, parameter, and return value
  1. Create another package with an appropriate name in the src folder of your project
  1. Using the Refactor command, move Time.java into your new package folder
  1. Generate the html “help” pages for the Time class
  1. Open the file Time.html in your browser (or NetBeans) and make sure all of the necessary information appears. If not, correct the documentation comments (or add the missing ones) and create the html file again
  1. Note that the required package statement has been added to Time.java

Check: ______