public class Main
{
public static void main(String[] args) {
Bird brd=new Bird(123,"ostrich","black");
Reptile rept=new Reptile(145,"lizard",45.75);
}
}
class Animal{
private int IDtag;
private String species;
public Animal(int id, String s){
IDtag=id;
species=s;
}
}
class Bird extends Animal{
private String colour;
public Bird(int id, String s, String c){
super(id, s);
colour=c;
}
}
class Reptile extends Animal{
private double bloodTemp;
public Reptile(int id,String s, double b){
super(id, s);
bloodTemp=b;
}
}
Comments
Leave a comment