Exercice (cont.)
Another example of an application is given here
- Extract the content of the file.
- Run the program with:
java -cp . organization.Demo
.
(option) you can re-build with: javac -cp . organization/*.java
- Understand the main program:
package organization;
public class Demo {
public static void main(String[] args) {
NamedElement ne1 = new Person("John");
NamedElement ne2 = new Person("Bill");
NamedElement ne3 = new Person("Kate");
Group a1 = new Group("1A");
Group ase = new Group("ASE");
Group ir = new Group("IR");
a1.add(ase); a1.add(ir);
ase.add(ne1); ase.add(ne2); ir.add(ne3);
System.out.println( a1 );
}
}
- Represent the UML/SysML classes' diagram of the application.
14 - 14Java 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