Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package app;
  2.  
  3. public class Zoo {
  4.     public static void main(String[] args) {
  5.         Animal tiger = new Animal("carnivore", "Africa");
  6.         String d = tiger.getDiet();
  7.         String n = tiger.getNativeTo();
  8.  
  9.         Animal bear = new Animal("herbivore", "North America");
  10.         String b = bear.getDiet();
  11.         String h = bear.getNativeTo();
  12.  
  13.         System.out.println("The Tiger has a Diet of: " + d + " and is native to: " + n);
  14.         System.out.println("The Bear has a Diet of: " + b + " and is native to: " + h);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement