TP3 Exception Java Avancé

Embed Size (px)

DESCRIPTION

ok

Citation preview

  • TP3 Java avanc Les Exceptions - Licence 3 D2AW - UADB

    Nom : DIOME

    Prnom : Michel Xenni

    Date de naissance : 10 Avril 1992 Joal-Fadiouth

    package tdexception; public class AgeNegExc extends Exception{ }

    package tdexception; public class PrenomExc extends Exception{ }

    package tdexception; public class Personne { private String nom; private String prenom; private int age; public Personne(){ this.nom = "Inconnu"; this.prenom = "Inconnu"; this.age = 0; } public Personne(String nom, String prenom, int age) throws AgeNegExc, PrenomExc{ if(age < 0 ){ throw new AgeNegExc(); } if(prenom.length()