Really new to java here. I am trying to build on an abstract class, Animals, extending it to a subclass Ducks. I'll then create an object ducksworth, that proves Duck inherited the methods from the superclass animals, and can call on references to the abstract class variables. When I try and run my code in Netbeans, it is unable to find a main method call, even though the class AllAnimals contains a main call. Any help would be appreciated? This code is entirely written in a single file in Netbeans.
Ideally what I would like as output is "feather"
abstract class Animal {
String FUR= "fur";
String FEATHER = "feather";
String SCALE = "scale";
String SHELL = "shell";
String SKIN = "skin";
abstract String getCovering( );
abstract void makeSound();
abstract boolean canFly( );
}
class Duck extends Animal {
String covering = FEATHER;
String sound = "quack";
boolean flight = true;
String getCovering() {
System.out.println("Ducks are covered in " + covering);
return covering;
}
void makeSound() {
System.out.println(sound);
}
boolean canFly() {
return flight;
}
}
class allanimals {
public static void main(String[] args) {
Duck ducksworth = new Duck();
ducksworth.getCovering();
}
}