4) Write java code for a Animal class. Part of this is shown(including the getWeight method). 20 points
class Animal {
private String breed; // type of Animal (dog, cat,
// etc)
private String food; // food eaten by Animal
private int age; // age of Animal in years
// must be >= 0
private float weight; // min weight
// must be >= 0.5
float getWeight() {
return weight;
}
// methods for the Animal class that you will need
// to fill in go here…
}
a) Write a constructor method for the Animal class, to set thedefault breed to “bat”, the default food to “bug”, the default ageto 0, and the default
PayPal Gateway not configured
PayPal Gateway not configured