As far as the compiler is concerned, there is no difference. As far as the programmer is concerned doc comments begin with /** and regular comments begin with /*. Doc comments are automatically parsed out by javadoc.
/**
* This class represents a node of a binary tree.
* @version 1.0 of August 26, 1996
* @author Elliotte Rusty Harold
*/
public class treenode {
double data;
treenode left;
treenode right;
/**
* Creates a new node with the value d
* @param d The number to be stored in the node
*/
public treenode (double d) {
data = d;
left = null;
right = null;
}
/**
* This method stores a double in the tree by adding a new node
* with the value d below the current node.
* @param d The number to be stored in the tree
*/
public void store (double d) {
if (d <= data) {
if (left == null) left = new treenode(d);
else left.store(d);
}
else {
if (right == null) right = new treenode(d);
else right.store(d);
}
}
/**
* This method prints this node on System.out.
*/
public void print() {
if (left != null) left.print();
System.out.println(data);
if (right != null) right.print();
}
}