Hello World !
This is a first/simple example of a Java program.
- Take an editor and make a new file called
Hello.java
with the following code:
public class Hello {
public static void main(String args[]) {
System.out.println("Hello World !");
}
}
- A
class
is a re-usable piece of software that as a name (starting with an Uppercase !) and is saved with a .java
extension.
- The
main
program is an operation proposed by this class ; the operation takes an array []
of texts called args
from the class String
.
- Another sample class is
System
that represents the computer with its keyboard (in
property/attribute) and screen (out
property).
- This latter is also an illustration of (
static
) object
that proposes an operation to print
a text (String
) with a new line at end (see 'ln' at end of print).
3 - 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