Hello World !
As another complement, it is usual to add comments
into code to describe what is a class for, the behavior of an operation, etc. These comments can then be exploited to generate the HTML documentation of a code with the javadoc
tool. In particular, the Java API is documented in this way and is available here.
- Add comments in Person.java:
/**
* Sample class that does greetings.
**/
public class Person {
/**
* Sample operation/method.
* @param s : person's name to say 'Hello'
**/
public void sayHello(String s) {
System.out.println("Hello "+ s +" !");
}
}
Create a doc
directory and generate documentation:
mkdir doc
javadoc -d doc src/hello/*.java
Now, take a look at the generated documentation at doc/index.html.
10 - 17Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented
Java jva jav laurent thiry uha enseignant ensisa ecole school national alsace programmation objet approche mulhouse france java object programming oriented