Posto il codice con gli errori (sto studiando da poco, gli errori saranno molto stupidi)
il primo file Person non da errori
Questi sono gli errori del secondo file calculateAge
calculateAge.java:4: error: cannot find symbol
int ageDays = ageYears * 365;
^
symbol: variable ageYears
location: class calculateAge
calculateAge.java:6: error: cannot find symbol
Person m = new Person(ageYears, ageDays, ageSeconds);
^
symbol: variable ageYears
location: class calculateAge
2 errors
public class Person {
public static int ageYears;
public static int ageDays;
public static int ageSeconds;
Person(int ageYears, int ageDays,int ageSeconds){
this.ageYears = ageYears;
this.ageDays = ageDays;
this.ageSeconds = ageSeconds;
}
public void stamp() {
System.out.println("You are" + ageDays + "days old");
System.out.println("You are" + ageSeconds + "seconds old");
}
}
public class calculateAge {
public static void main(String[] args) {
int ageDays = ageYears * 365;
int ageSeconds = ageDays * 24 * 60 * 60;
Person m = new Person(ageYears, ageDays, ageSeconds);
m.stamp();
}
}
grazie per la disponibilità