1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| public class Calendar {
private static int jour;
private static int mois;
private static int annee;
public void Saisir(){
System.out.println("Veuillez saisir la date du jour ");
jour = Keyboard.readInt();
mois = Keyboard.readInt();
annee = Keyboard.readInt();
}
public static boolean estValide(int annee, int mois, int jour){
Calendar c = Calendar.getInstance();
c.setLenient(false);
c.set(annee,mois,jour);
try{
c.getTime();
}
catch(IllegalArgumentException iAE){
return false;
}
return true;
}
private void getTime() {
// TODO Auto-generated method stub
}
private void set(int annee2, int mois2, int jour2) {
// TODO Auto-generated method stub
}
private void setLenient(boolean b) {
// TODO Auto-generated method stub
}
private static Calendar getInstance() {
// TODO Auto-generated method stub
return null;
}
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(estValide(annee,mois,jour));
}
} |