Thinking in Java Fourth Edition Bruce Eckel Chapter 1 Exercise 12

Exercise 12: Find the code for the second version of HelloDate.java, which is the simple comment documentation example. Execute Javadoc on the file and view the results with your Web browser.

Solution:

import java.util.*;

/** The first Thinking in Java example program.
* Displays a string and today's date.
* @author http://studentclan.com
* @author Ghost
* @version 1.0
*/


public class DocTest
{
    /** Entry poing to class & application.
    * @param args array of string arguments
    * @throws exceptions No exceptions thrown
    */

    public static void main(String[] args)
    {
        System.out.println("Hello, it's: ");
        System.out.println(new Date());
    }
}

Output:

Leave a Reply

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