Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public class Solution {
  2. public static void main(String[] args) {
  3. Cat catVaska = new Cat();
  4. catVaska.name = "Vaska";
  5. catVaska.age = 3;
  6. catVaska.weight = 4;
  7. catVaska.strength = 2;
  8. Cat catBorz = new Cat();
  9. catBorz.name = "Borz";
  10. catBorz.age = 4;
  11. catBorz.weight = 5;
  12. catBorz.strength = 10;
  13. Cat catMarseille = new Cat();
  14. catMarseille.name = "Marseille";
  15. catMarseille.age = 1;
  16. catMarseille.weight = 1;
  17. catMarseille.strength = 3;
  18. }
  19.  
  20. public static class Cat {
  21.  
  22. public static int count = 0;
  23. private String name;
  24. private int age;
  25. private int weight;
  26. private int strength;
  27.  
  28. public Cat(String name, int age, int weight, int strength) {
  29. count++;
  30.  
  31. this.name = name;
  32. this.age = age;
  33. this.weight = weight;
  34. this.strength = strength;
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement