I've searched and read my text book for what is probably a basic question but can't seem to figure it out.
I have the following 3 classes. One abstract, one interface and a regular class. In the Cat class I want to call the Animal class constructors within a Cat constructor method but get an error. What am i doing wrong?
package MyPet;
public interface WalkMe {
public void walk();
}
package MyPet;
public abstract class Animal{
private int legs;
private String name;
public abstract String toString();
public Animal(int legs_in, String name_in){
setLegs(legs_in);
setName(name_in);
}
...removed the rest of code
}
package MyPet;
public class Cat extends Animal implements WalkMe{
public void walk() {
System.out.println(" ");
}
public String toString() {
}
public Cat(){
Animal(0, "Unnamed"); //THIS IS WHAT I NEED HELP WITH I am trying to call the animal Constructor
}
public static void main(String[] args) {
Cat[] cats = new Cat[4];
cast[0] = new Cat();
}
}