Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Date {
- int jours; /// les jours
- int mois ; //// le mois
- int annee ; //// l'annnée
- public Date(int j, int m, int a) {
- jours = j ;
- mois = m ;
- annee = a ;
- }
- public String toString() {
- String str = "" ;
- if (jours < 10) {
- str = "0" + jours + "/" ;
- }
- else {
- str = jours + "/" ;
- }
- if (mois < 10) {
- str = str + "0" + mois + "/" ;
- }
- else {
- str = str + mois + "/" ;
- }
- str = str + annee ;
- return str ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement