码迷,mamicode.com
首页 > 编程语言 > 详细

Javadoc

时间:2020-02-08 20:49:27      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:ica   string   nal   boolean   pre   spl   col   static   The   

/**
 * The student class is basic class.
 * @author Leon
 *
 */
public class Student {

/**
 * @param name The student‘s name
 * @param id student‘s id
 */
    public Student(String name, int id) {
        studentName = name;
        studentId = id;
    }

/**
 * Gets name of student
 * @return the name of student
 */
    public String getName() {
        return studentName;
    }
    
/**
 * Gets id of student
 * @return the id of student
 */
    public int getId() {
        return studentId;
    }
    
/**
 * sets the number of credits enarned.
 * @param credits The new number of credits earned
 */
    public void setCredits(double credits) {
        creditsEarned = credits;
    }
    
/**
 * Gets the number of credits earned.
 * @return The number of credits this student has earned
 */    
    public double getCredits() {
        return creditsEarned;
    }
    
/**
 * Sets whether the student is paid up.
 * @param flag The value true or false indicating paid-up status
 */    
    public void setPaidUp(boolean flag) {
        paidUp = flag;
    }

/**
 * Returns whether the sutdent is paid up.
 * @return Whether the student is paid up.
 */
    public boolean isPaidUp() {
        return paidUp;
    }

/**
 * Creates a string identifying this student.
 * @return The string used to display this student.
 */
    public String toString() {
        return studentName + " (#" + studentId + ")";
    }

/* public constants */
    public static final double CREDITS_TO_GRADUATE = 32.0;
    
/* Private instance variables */
    private String studentName;        /* The student‘s name */
    private int studentId;            /* The student‘s id */
    private double creditsEarned;    /* The number of credits earned */
    private boolean paidUp;            /* Whether student is paid up */
 
}

Javadoc

/** 开头

@param 这种特殊的

 

可以通过 eclipse 等工具生成 java doc 文件.

也可以使用命令 javadoc Student.java 来生成说明文档 (在 Student.java 同一个目录下)

Javadoc

标签:ica   string   nal   boolean   pre   spl   col   static   The   

原文地址:https://www.cnblogs.com/moveofgod/p/12285016.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!