1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
public class Ville {
protected String nomVille;
protected String nomPays;
protected int nbreHab;
public Ville(String nomVille, int nbreHab, String nomPays) {
this.nomVille = nomVille;
this.nbreHab = nbreHab;
this.nomPays = nomPays;
}
public String decrisToi() {
return "\t" + this.nomVille + " est une ville de " + this.nomPays + ", elle comporte : " + this.nbreHab+" habitants";
}
/**
* @return the nomVille
*/
public String getNomVille() {
return nomVille;
}
/**
* @param nomVille the nomVille to set
*/
public void setNomVille(String nomVille) {
this.nomVille = nomVille;
}
/**
* @return the nomPays
*/
public String getNomPays() {
return nomPays;
}
/**
* @param nomPays the nomPays to set
*/
public void setNomPays(String nomPays) {
this.nomPays = nomPays;
}
/**
* @return the nbreHab
*/
public int getNbreHab() {
return nbreHab;
}
/**
* @param nbreHab the nbreHab to set
*/
public void setNbreHab(int nbreHab) {
this.nbreHab = nbreHab;
}
} |
Partager