Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package app;
- public class Zoo {
- public static void main(String[] args) {
- Animal tiger = new Animal("carnivore", "Africa");
- String d = tiger.getDiet();
- String n = tiger.getNativeTo();
- Animal bear = new Animal("herbivore", "North America");
- String b = bear.getDiet();
- String h = bear.getNativeTo();
- System.out.println("The Tiger has a Diet of: " + d + " and is native to: " + n);
- System.out.println("The Bear has a Diet of: " + b + " and is native to: " + h);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement