Class Personne

java.lang.Object
Personne

public class Personne
extends java.lang.Object
Il s'agit d'une classe permettant de représenter un individu. Les individus possèdent différents attributs comme un nom et un âge. Une exemple de création d'un individu nommé Smith et ayant 40 ans :
Personne p = new Personne("Smith",40);
  • Constructor Summary

    Constructors 
    Constructor Description
    Personne​(java.lang.String n, int a)  
  • Method Summary

    Modifier and Type Method Description
    int getAge()  
    java.lang.String getNom()
    Renvoie le nom de la personne.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Personne

      public Personne​(java.lang.String n, int a)
  • Method Details

    • getNom

      public java.lang.String getNom()
      Renvoie le nom de la personne.
      Returns:
      le nom de la personne
    • getAge

      public int getAge()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object