Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public class Personne {
  2. private String nom;
  3. private String prenom;
  4. private int age;
  5. public Personne(String nom,String prenom,int age){
  6. this.nom=nom;
  7. this.prenom=prenom;
  8. this.age=age;
  9. }
  10. /**@param nom: le nom à définir*/
  11. public void setNom(String nom){
  12. this.nom=nom;
  13. }
  14. public String getNom(){
  15. return this.nom;
  16. }
  17. /**@param prenom: le prénom à définir*/
  18. public void setPrenom(String prenom){
  19. this.prenom=prenom;
  20. }
  21. public String getPrenom(){
  22. return this.prenom;
  23. }
  24. /**@param age: l'âge à définir*/
  25. public void setAge(int age){
  26. this.age=age;
  27. }
  28. public int getAge(){
  29. return this.age;
  30. }
  31. public String toString(){
  32. return "Nom : "+this.nom+" ; Prénom : "+this.prenom+" ; Âge : "+this.age;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement