I have the following problem. I have two classes - one is the base class and the pther is inheriting it. So in the parent class is an abstract class and it consists three fields - String name, String adress and int age. However in my task it says the value for age has to be set by default to be 25 years. My question is - How do implement this value with the help of inherited method setAge() in the constructor of the inherited class? My abstract constructor looks like this:
public Student(String name, String adress, int age){
this.setName(name);
this.setAdress(adress);
this.setAge(age);
}
and setter:
public void setAge(int age){
this.age = age;
}
How do I do the implementation in the inherited class by using a default value?