Thinking in Java Fourth Edition Bruce Eckel Chapter 1 Exercise 13

Exercise 13: Run Documentation1.java, Documentation2.java, and Documentation3.java through Javadoc. Verify the resulting documentation with your Web browser.

Solution:

/** A class comment */
public class Documentation1
{
    /** A field comment */
    public int i;
    /** A method comment */
    public void f()
    {
    }
}
import java.util.*;

/**
* <pre>
* Uses
* System.out.println(new Date());
* </pre>
*/


public class Documentation2
{
    Date d = new Date();
    void showDate()
    {
        System.out.println("Date = " + d);
    }
}
import java.util.*;

/**
* You can even insert a list:
* <ol>
* <li> Item one
* <li> Item two
* <li> Item three
* </ol>
*/


public class Documentation3
{
    public static void main(String[] args)
    {
        Date d = new Date();
        System.out.println("d = " + d);
    }
}

Output:



Leave a Reply

Your email address will not be published. Required fields are marked *