Académique Documents
Professionnel Documents
Culture Documents
personne.nbPersonne();
ackage abstractpersonne;
void ecrirePersonne ()
{
System.out.println ("Secrétaire : " + toString());
}
package abstractpersonne;
public class Etudiant extends personne {
String diplomeEnCours;
static int nbEtudiants;
void ecrirePersonne ()
{
System.out.println ("Etudiant : " + toString());
}
package abstractpersonne;
public Enseignant (String nom, String prenom, String rue, String ville,
String specialite)
{
super (nom, prenom, rue, ville);
this.specialite = specialite;
nbEnseignants++;
}
void ecrirePersonne ()
{
System.out.println ("Enseignant : " + toString());
}
Exercice2 :
void ObjetGraphique()
{
x=0;y=0;
}
}
public void setTaille(double largeur, double hauteur)
{
this.largeur = largeur;
this.hauteur = hauteur;
}
}}
String text ;
}
public void setText(String text )
{
this .text=text;
}
String getText()
{
return text;
}}
public class Cercle extends ObjetGraphique {
double rayon ;
x=Crcl.x;
y=Crcl.y;
rayon=Crcl.rayon;
}
void affiche() {
Partie 2 : (Interfaces)
Exercice 3 (Gestion de stock d'un magasin)