I have the Prestamo classes
public class Prestamo extends Pago{
private Fecha[] fechasPago;
public Prestamo(){}
public void setFechasPago(Fecha[] fechasPago){
this.fechasPago=fechasPago;
}
public Fecha[] getFechasPago(){
return fechasPago;
}
}
and Date
public class Fecha {
private int anio;
private int dia;
private int mes;
public Fecha() {
}
public Fecha(int dia, int mes, int anio){
setAnio(anio);
setDia(dia);
setMes(mes);
}
public int getAnio(){
return anio;
}
public int getDia(){
return dia;
}
public int getMes(){
return mes;
}
public void setAnio(int anio){
this.anio=anio;
}
public void setDia(int dia){
this.dia=dia;
}
public void setMes(int mes){
this.mes=mes;
}
}
Obviously the classes have more methods and attributes only for the example.
On the other hand the question would be, what happens is that as you see there is an attribute private Fecha[] fechasPago;
which is for the following, in the main is entered by keyboard a day, a month and a year but from that date should be count a month later for a year, example if you enter day 21, month 06, year 2018 the vector must keep all 21 of each month until the year 2019 but the question would be how to relate if in the class Prestamo
there is a vector of type Fecha
how would it be implemented in the Main and also be printed every month until its date?