java第四天

p32~p36:

学习javadoc

1、第一步,打开一个一定规模的java项目

2、第二步,搭建测试环境

IntelliJ IDEA ——> Tools ——> Generate JavaDoc...

——> -encoding UTF-8 -charset UTF-8

3、第三步,参照corejava给所有类打一遍Javadoc注释

遇到的问题:

1、ant的用法。

2、代码正确性的验证:/*Output:。

例1

//: object/Documentation1.java
/** A class comment */
public class Documentation1 {
  /** A field comment */
  public int i1;
  /** A field comment */
  public int i2;
  /** A method comment */
  public void f1() {}
  /** A method comment */
  public void f2() {}
} ///:~

例2

//: object/HelloDate.java
import java.util.*;

/** The first Thinking in Java example program.
 * Displays a string and today's date.
 * @author Bruce Eckel
 * @author www.MindView.net
 * @version 4.0
*/
public class HelloDate {
  /** Entry point 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: (55% match)
Hello, it's:
Wed Oct 05 14:39:36 MDT 2005
*///:~

 

原文地址:https://www.cnblogs.com/xkxf/p/6415928.html