document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public class Data
  2. {
  3.     private int giorno;
  4.     private int mese;
  5.     private int anno;
  6.    
  7.     public Data(int giorno, int mese, int anno)
  8.     {
  9.         this.setAnno(anno);
  10.         this.setMese(mese);
  11.         this.setGiorno(giorno);
  12.     }
  13.    
  14.     public int getGiorno()
  15.     {
  16.         return giorno;
  17.     }
  18.    
  19.     public int getMese()
  20.     {
  21.         return mese;
  22.     }
  23.    
  24.     public int getAnno()
  25.     {
  26.         return anno;
  27.     }
  28.    
  29.     public void setGiorno(int giorno)
  30.     {
  31.         if(giorno > 0 && giorno < 32)
  32.         {
  33.             this.giorno = giorno;
  34.         }
  35.         else
  36.         {
  37.             this.giorno = 1;
  38.         }
  39.     }
  40.    
  41.     public void setMese(int mese)
  42.     {
  43.         if(mese > 0 && mese < 13)
  44.         {
  45.             this.mese = mese;
  46.         }
  47.         else
  48.         {
  49.             this.mese = 1;
  50.         }
  51.     }
  52.    
  53.     public void setAnno(int anno)
  54.     {
  55.         if(anno > -1 && anno < 2014)
  56.         {
  57.             this.anno = anno;
  58.         }
  59.         else
  60.         {
  61.             this.anno = 2013;
  62.         }
  63.     }
  64. }
');