Commit 57cb7e37 authored by elijah vasquez's avatar elijah vasquez 🦍

commits

parent 97a5e721
public class Amphibians extends animal {
}
File added
public class Birds extends animal {
String birdAction;
Birds(String animalName, String givenName, String gender, String sound, String birdAction, int age, int lifespan, int height, int weight) {
super(animalName, givenName, gender, sound, age, lifespan, height, weight);
this.birdAction = birdAction;
}
}
\ No newline at end of file
public class Carnivores extends Diet {
Carnivores(String foodName) {
super(foodName);
}
}
public class Diet {
String foodName;
Diet(String foodName){
this.foodName = foodName;
}
}
public class Fish extends animal{
}
File added
public class Habitat {
String habitatName;
int habitatTemp;
Habitat(String habitatName, int habitatTemp) {
}
this.habitatName = habitatName;
this.habitatTemp = habitatTemp;
}
public class Herbivores extends Diet {
Herbivores(String foodName) {
super(foodName);
}
}
public class Mammals extends animal {
}
public class Omnivores extends Diet {
Omnivores(String foodName) {
super(foodName);
}
}
public class Reptiles extends animal {
}
No preview for this file type
public class animal {
String animalName;
String givenName;
String gender;
int age;
int height;
int weight;
int lifespan;
String dietType;
String animalName, givenName, gender, sound;
int age, lifespan, height, weight;
Habitat habitat;
Diet dietType;
animal(String animalName, String givenName, String gender, String sound, int age, int lifespan, int height, int weight) {
this.animalName = animalName;
this.givenName = givenName;
this.gender = gender;
this.sound = sound;
this.age = age;
this.height = height;
this.weight = weight;
}
}
\ No newline at end of file
No preview for this file type
// The Zoo
import java.util.ArrayList;
public class main {
public static void main(String[] args){
public static void main(String[] args) throws Exception {
ArrayList<animal> animals = new ArrayList<animal>();
// Bird types
animal batFalcon = new Birds("BatFalcon", "Griffith", "M", "Screech", "flies", 9, 18, 30, 230);
batFalcon.dietType = new Carnivores("Bats");
batFalcon.habitat = new Habitat("Islands", 34);
animals.add(batFalcon);
//Reptile Types
//Mammal Types
//Fish Types
//Amphibian Types
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment