Exeception
Résolu/Fermé2 réponses
KX
Messages postés
16733
Date d'inscription
samedi 31 mai 2008
Statut
Modérateur
Dernière intervention
31 janvier 2024
3 015
16 juin 2013 à 11:46
16 juin 2013 à 11:46
Le try/catch c'est pour récupérer l'exception, si tu veux en lever une il te faut un throw
public void Park(int numPlace, Car C) { if (Garage.containsKey(numPlace)) throw new IllegalStateException("Place déjà occupée"); else Garage.put(numPlace, C); }