can't seem to figure out why my program won't run.
can’t seem to figure out why my program won’t run. I am not even sure if I have the Animal newInstance method
written correctly in my Animal class. I am new to Java and am struggling with this. I have attached what I have done so far. Here is my Mammal class (since I couldn’t attach it). Can you help with cleaning up my code so that it will run? And help me with the Test class? I have not been able to figure out how to do that.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package animalstuff;
/**
*
* @author
*/
public class Mammal extends Animal {
String integument = “hair”;
@Override
public String movement (boolean fast){
if (fast == true){
return “I run.”;
} else {
return “I walk.”;
}
}
public class Cow extends Mammal {
public Cow(){
Cow.kind = “cow”;
}
public void newCow(){
}
@Override
public String sound(){
return “‘Moo Moo'”;
}
}
public class Horse extends Mammal {
public Horse(){
Horse.kind = “horse”;
}
public void newHorse(){
}
@Override
public String sound(){
return “‘Hee Haw'”;
}
}
public class Dog extends Mammal {
public Dog(){
Dog.kind = “dog”;
}
public void newDog(){
}
@Override
public String sound(){
return “‘Woof Woof'”;
}
}
public class Cat extends Mammal {
public Cat(){
Cat.kind = “cat”;
}
public void newCat(){
}
@Override
public String sound(){
return “‘Meow Meow'”;
}
}
}//END OF MAMMAL CLASS
