Java comments can be used to generate documentation. But not any comment, only those matching the specification.
/**
* Returns the employee with the received code.
*
* @param id
* employee id
* @return name of the employee with the id
*/
public String getEmployeeName(final Integer id);
Generating Javadoc
It is recommended using a project management tool, such as Maven, to generate Javadocs.