Javadoc在发生重大变化后停止更新

时间:2013-05-27 21:31:51

标签: java eclipse javadoc

出于某种原因,我的Javadoc已停止检测对类描述的更改。例如,我有一个具有描述A sample of Swing and reference types.的类,我将其更改为A sample of Swing and reference types. (Page 78),但即使删除所有Javadoc文件夹并重新生成它,它仍然会显示A sample of Swing and reference types.。我在Eclipse中使用Javadoc,我确实选择了正确的Javadoc程序。这是另一个根本不会生成javadoc描述的程序:

package com.nathan2055.booksamples;

/**
 * This program calculates 228 cents of change out.
 * @author Nathan2055
 */

import static java.lang.System.out;

public class CalculatingChange {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // 248 cents...
        int total = 248;

        // How many quarters?
        int quarters = total / 25;
        int whatsLeft = total % 25;

        // How many dimes?
        int dimes = whatsLeft / 10;
        whatsLeft = whatsLeft % 10;

        // How many nickels?
        int nickels = whatsLeft / 5;
        whatsLeft = whatsLeft % 5;

        // How many are left?
        int cents = whatsLeft;

        // And then tell me.
        out.println("From " + total + " cents you get:");
        out.println(quarters + " quarters");
        out.println(dimes + " dimes");
        out.println(nickels + " nickels");
        out.println(cents + " cents");


    }

}

1 个答案:

答案 0 :(得分:2)

这是问题所在:

/**
 * This program calculates 228 cents of change out.
 * @author Nathan2055
 */

import static java.lang.System.out;

public class CalculatingChange {

javadoc必须在类声明之前直接 。你在import语句之前得到了它。因此,虽然上述方法不起作用,但这样做:

import static java.lang.System.out;

/**
 * This program calculates 228 cents of change out.
 * @author Nathan2055
 */    
public class CalculatingChange {