Advertisement
michael_xgrind

Data

May 28th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. //Michael Martins
  2.  
  3. public class Data {
  4.     private int dia, mes, ano, dias;
  5.    
  6.     public Data() {
  7.         dia = mes = ano = 1;
  8.     }
  9.    
  10.     public Data(int dia) {
  11.         this.dia = dia;
  12.     }
  13.    
  14.     public void setDia(int dia) {
  15.         this.dia = dia;
  16.     }
  17.    
  18.     public void setMes(int mes) {
  19.         this.mes = mes;
  20.     }
  21.    
  22.     public void setAno(int ano) {
  23.         this.ano = ano;
  24.     }
  25.    
  26.     public void setDias() {
  27.         dias = dia + mes * 30 + ano * 365;
  28.     }  
  29.    
  30.     public int getDias() {
  31.         setDias();
  32.         return dias;
  33.     }  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement