public class Animal
{
public String name;
public boolean legs;
public boolean eyes;
public Animal(String name, boolean legs, boolean eyes)
{
this.name = name;
this.legs = legs;
this.eyes = eyes;
}
}
public class Dog extends Animal
{
String name;
boolean legs;
boolean eyes;
public boolean vacinated;
public boolean rabid;
public Dog(boolean vacinated, boolean rabid, String name, boolean legs, boolean eyes)
{
super(name, legs, eyes);
this.vacinated = vacinated;
this.rabid = rabid;
}
}
public class Bulldog extends Dog
{
String name;
boolean legs;
boolean eyes;
public boolean vacinated;
public boolean rabid;
public String breedtype;
public Bulldog(String breedtype, String name, boolean legs, boolean eyes, boolean vacinated, boolean rabid)
{
super(vacinated, rabid, name, legs, eyes);
this.breedtype = breedtype;
}
}
As you can see, if this keeps going on and on, in other words, if I have a really long inheritance line, would I seriously need to list out every single variable over and over again? I just feel like there is a a much more efficient way to do this.