Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.net.IDN;
- import java.util.HashMap;
- import java.util.Collections;
- import java.util.Scanner;
- import java.util.Random;
- public class Animals {
- static void Sound (){
- System.out.println("Animal Default sound ");
- Scanner Scan = new Scanner (System.in);
- Random Rand = new Random();
- }
- }
- class Dog extends Animals{
- static void Dog(){
- Random Rand = new Random();
- int Age = Rand.nextInt(10);
- int weight = Rand.nextInt (50+1);
- long Idnum = Rand.nextLong();
- System.out.println("Age: "+Age+ "\nWeight: " + weight+"\nIdNum: "+ Idnum);
- }}
- class Cat extends Animals{
- static void Cat(){
- Random Rand = new Random();
- int Age = Rand.nextInt(10);
- int weight = Rand.nextInt (50+1);
- long Idnum = Rand.nextLong();
- System.out.println("Age: "+Age+ "\nWeight: " + weight+"\nIdNum: "+ Idnum);
- }}
- class Tiger extends Animals {
- static void Tiger() {
- Random Rand = new Random();
- int Age = Rand.nextInt(10);
- int weight = Rand.nextInt(50 + 1);
- long Idnum = Rand.nextLong();
- System.out.println("Age: " + Age + "\nWeight: " + weight + "\nIdNum: " + Idnum);
- }
- }
- class Lion extends Animals {
- static void Lion() {
- Random Rand = new Random();
- int Age = Rand.nextInt(10);
- int weight = Rand.nextInt(50 + 1);
- long Idnum = Rand.nextLong();
- System.out.println("Age: " + Age + "\nWeight: " + weight + "\nIdNum: " + Idnum);
- }
- }
- class Program extends Animals{
- public static void main(String args[]) {
- System.out.println("Please Pick An Animal! OR You can pick Random."+"\nDog \nCat\nTiger\nLion");
- Dog D = new Dog();
- //D.Dog():
- Cat C = new Cat();
- //C.Cat();
- Tiger T = new Tiger();
- //T.Tiger():
- Lion L = new Lion();
- L = new Lion ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement