Buongiorno,
sto provando gli array utilizzando Netbeans, ho fatto due sorgenti che posto in seguito, quando faccio il run
mi indica questo Errore: impossibile trovare o caricare la classe principale vacationscaletest.VacationScaleTes
potreste aiutarmi ?
public class VacationScaleTest {
public static void main (String args[]) {
VacationScale myVacationScale = new VacationScale();
// myVacationScale.setVacationScale();
myVacationScale.yearsOfService = 1;
myVacationScale.displayVacationDays();
myVacationScale.yearsOfService = 5;
myVacationScale.displayVacationDays();
myVacationScale.yearsOfService = 10;
myVacationScale.displayVacationDays();
}
}
public class VacationScale {
int [] vacationDays = {20,40,60,80,100,120,140,160,180,200 };
int yearsOfService;
VacationScale(int [] vacationDays, int yearsOfService) {
this.vacationDays = vacationDays;
this.yearsOfService = yearsOfService;
}
void displayVacationDays() {
System.out.println(vacationDays[yearsOfService]);
}
}