We already saw how comments are added to Java code. JavaDoc is a JDK tool that automaticaly generates documentation for classes as HTML documents. As explained in the lecture http://cs.iit.edu/~glavic/cs116//lectures/javadoc.html#/, comments starting with /**
are used to document classes, methods, fields, and more. Inside these comments, elements prefixed with @
have specific meaning (e.g., document a method parameter with @param
.
package lecture;
/**
* This is a simple class which only prints <it>"hello world"</it> when its main method is called.
*
* This class desc. .....
*
* @author lord_pretzel
*
*/
public class MyFirstClass {
/**
* The main methods prints <it>"hello world"</it>. Nothing more to tell you really.
*
* I designed this method because I was bored.
*
* @param args parameters are ignored
*/
public static void main(String[] args) {
System.out.println("hello world");
}
}