Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static void main(String[] args) {
- Cat catVaska = new Cat();
- catVaska.name = "Vaska";
- catVaska.age = 3;
- catVaska.weight = 4;
- catVaska.strength = 2;
- Cat catBorz = new Cat();
- catBorz.name = "Borz";
- catBorz.age = 4;
- catBorz.weight = 5;
- catBorz.strength = 10;
- Cat catMarseille = new Cat();
- catMarseille.name = "Marseille";
- catMarseille.age = 1;
- catMarseille.weight = 1;
- catMarseille.strength = 3;
- }
- public static class Cat {
- public static int count = 0;
- private String name;
- private int age;
- private int weight;
- private int strength;
- public Cat(String name, int age, int weight, int strength) {
- count++;
- this.name = name;
- this.age = age;
- this.weight = weight;
- this.strength = strength;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement