Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1.  
  2. import java.net.IDN;
  3. import java.util.HashMap;
  4. import java.util.Collections;
  5. import java.util.Scanner;
  6. import java.util.Random;
  7. public class Animals {
  8. static void Sound (){
  9. System.out.println("Animal Default sound ");
  10. Scanner Scan = new Scanner (System.in);
  11. Random Rand = new Random();
  12. }
  13. }
  14. class Dog extends Animals{
  15. static void Dog(){
  16. Random Rand = new Random();
  17. int Age = Rand.nextInt(10);
  18. int weight = Rand.nextInt (50+1);
  19. long Idnum = Rand.nextLong();
  20. System.out.println("Age: "+Age+ "\nWeight: " + weight+"\nIdNum: "+ Idnum);
  21. }}
  22. class Cat extends Animals{
  23. static void Cat(){
  24. Random Rand = new Random();
  25. int Age = Rand.nextInt(10);
  26. int weight = Rand.nextInt (50+1);
  27. long Idnum = Rand.nextLong();
  28. System.out.println("Age: "+Age+ "\nWeight: " + weight+"\nIdNum: "+ Idnum);
  29. }}
  30. class Tiger extends Animals {
  31. static void Tiger() {
  32. Random Rand = new Random();
  33. int Age = Rand.nextInt(10);
  34. int weight = Rand.nextInt(50 + 1);
  35. long Idnum = Rand.nextLong();
  36. System.out.println("Age: " + Age + "\nWeight: " + weight + "\nIdNum: " + Idnum);
  37. }
  38. }
  39. class Lion extends Animals {
  40. static void Lion() {
  41. Random Rand = new Random();
  42. int Age = Rand.nextInt(10);
  43. int weight = Rand.nextInt(50 + 1);
  44. long Idnum = Rand.nextLong();
  45. System.out.println("Age: " + Age + "\nWeight: " + weight + "\nIdNum: " + Idnum);
  46. }
  47. }
  48. class Program extends Animals{
  49. public static void main(String args[]) {
  50. System.out.println("Please Pick An Animal! OR You can pick Random."+"\nDog \nCat\nTiger\nLion");
  51. Dog D = new Dog();
  52. //D.Dog():
  53. Cat C = new Cat();
  54. //C.Cat();
  55. Tiger T = new Tiger();
  56. //T.Tiger():
  57. Lion L = new Lion();
  58. L = new Lion ();
  59.  
  60.  
  61.  
  62.  
  63.  
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement