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 { public class animal {
String animalName; String animalName, givenName, gender, sound;
String givenName; int age, lifespan, height, weight;
String gender; Habitat habitat;
int age; Diet dietType;
int height; animal(String animalName, String givenName, String gender, String sound, int age, int lifespan, int height, int weight) {
int weight; this.animalName = animalName;
int lifespan; this.givenName = givenName;
String dietType; 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 // The Zoo
import java.util.ArrayList; import java.util.ArrayList;
public class main { public class main {
public static void main(String[] args){ public static void main(String[] args) throws Exception {
ArrayList<animal> animals = new ArrayList<animal>(); 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