I need to create a public method called mostraData
where a date is passed as a parameter (a parameter, not the separated day, month, and year), and the date is returned in the following format: dd / mm /aaaa
.
Keep in mind that if values have fewer digits, you must fill in with leading zeros to fit the default format. I already created the builder as I was asked in the exercise (one per default and another per parameter) with the requested attributes as well. Thank you.
package fechaapp;
public class Fecha {
private int dia;
private int mes;
private int anyo;
public Fecha(){
this.setDia(1);
this.setMes(1);
this.setAnyo(2000);
}
public Fecha(int dia, int mes, int anyo){
this.setDia(dia);
this.setMes(mes);
this.setAnyo(anyo);
}
public int getDia() {
return dia;
}
public void setDia(int dia) {
this.dia = dia;
}
public int getMes() {
return mes;
}
public void setMes(int mes) {
this.mes = mes;
}
public int getAnyo() {
return anyo;
}
public void setAnyo(int anyo) {
this.anyo = anyo;
}
public void mostraData(int fecha){
}
public void calculaSemanaMes(){}
public void calculaSemanaAnyo(){}
public void esAnyoExtraordinario() {}
public void calculaDiaSemana(){}
public void esFestivo(){}
public void esLaborable(){}
public void fechaFormat(){}
}