/*
*This is the first sample program in Core Java Chapter
*@author Cary Cornell
*@version 1.01 1997-03-22
*/
public class FirstSample
{
  public static void main(String[] args)
  {
    System.out.println("We will not use 'Hello, World!'");
  }
}在运行里面我对该段代码执行了javadoc -d d:\123 -author -version FirstSample.java这条指令,也生成了12个Html的网页还有其它的东西,但是我在所有的网页里面都找不到
This is the first sample program in Core Java 
Chapter  Cary Cornell
version 1.01 1997-03-22
这些信息,这个是为什么啊?
谢谢!

解决方案 »

  1.   

    因为你没有安装JavaDoc的规范来写注释,应该这样
    /**
     * This is the first sample program in Core Java Chapter
     * @author Cary Cornell
     * @version 1.01 1997-03-22
     */
    public class FirstSample
    {
      public static void main(String[] args)
      {
      System.out.println("We will not use 'Hello, World!'");
      }
    }
    JavaDoc生成的时候,不是所有的注释都能够生成到JavaDoc上的,之所以没出现你预期请,是注释采用的是普通的/* */,在类之前的注释需要用/** **/开头和结尾才能生成到JavaDoc上
    其他位置也有规定,你可以多看看