Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
CS 5JA Introduction to Java
Inheritance
But there is enough basic âfunctionalityâ in our prototype to make it useful to define
a kind of basic bird which will contain most of the elements for most of the
birds...
So weâll define a base class, which is the superclass for all the other birds. It wonât
extend from anything else
public class Bird
{
boolean migrates = false;
boolean canFly = true;
int colorful = false;
String favoriteFood = âwormsâ;
String typeOfBird;
public Bird(String typeOfBird)
{
this.typeOfBird = typeOfBird;
}
}