20Fermer22
EthanielLe 27/04/2007 à 15:21
Pen^2 (./12) :
alide!!!!!!! "); System.exit(1);
voici ce que fait ton constructeur :    if (hs>=0 && hs<45)
        this.heureSemaine = hs;
    else
        System.err.println("heureSemaine inv
"); System.exit(1); }
alors qu'il faudrait qu'il fasse :    if (hs>=0 && hs<45)
        this.heureSemaine = hs;
    else {
        System.err.println("heureSemaine invalide!!!!!!!
wink (ça quittait dans tous les cas avec le System.exit(1))
Code Conventions for the Java™ Programming Language
7.4 if, if-else, if else-if else Statements

Note: if statements always use braces {}. Avoid the following error-prone form:
    if (condition) //AVOID! THIS OMITS THE BRACES {}!
        statement;
Mes 0.30€ embarrassed...